)]}'
{
  "commit": "c82c611f105c0df064cc8c76363578caf9eafb75",
  "tree": "0b02e78403554e9e90db3ac13199dfe9aa538fd1",
  "parents": [
    "b62e4269829cfe3b019c3c494227409d72cc4eb4"
  ],
  "author": {
    "name": "Lei Zhang",
    "email": "thestig@chromium.org",
    "time": "Thu May 08 16:41:22 2025 -0700"
  },
  "committer": {
    "name": "Pdfium LUCI CQ",
    "email": "pdfium-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Thu May 08 16:41:22 2025 -0700"
  },
  "message": "M137: Revert \"Rework inline image parsing in content streams\"\n\nThis reverts commit c0bc98d0cacef2a77767aeee4a549a97271b9c4f.\n\nReason for revert: Broke inline image parsing for other PDFs\n\nBug: 407752631, 414588524, 416278203\nOriginal change\u0027s description:\n\u003e Rework inline image parsing in content streams\n\u003e\n\u003e Currently, CPDF_StreamContentParser:Handle_BeginImage() will try to\n\u003e parse inline images in content streams when it sees the \"BI\" operator.\n\u003e The parts that deal with the related \"ID\" and \"EI\" operators\n\u003e (Handle_BeginImageData() and Handle_EndImage(), respectively) are\n\u003e no-ops, since Handle_BeginImage() did all the work.\n\u003e\n\u003e Rework Handle_BeginImage() and Handle_BeginImageData() so\n\u003e CPDF_StreamContentParser records their respective keywords\u0027s positions.\n\u003e Then handle the inline image parsing in Handle_EndImage() with those\n\u003e positions. At this point, CPDF_StreamContentParser know the distance\n\u003e between the \"ID\" and \"EI\" operators, so it knows where the length of the\n\u003e inline image stream. Pass this length to\n\u003e CPDF_StreamParser::ReadInlineStream() and prevent it from reading the\n\u003e \"EI\" operator or past it.\n\u003e\n\u003e As a result of this change:\n\u003e - Handle_BeginImage() no longer needs to look for \"ID\" and \"EI\".\n\u003e - ReadInlineStream() no longer needs to looks for \"EI\".\n\u003e - bug_1236805.in fails because the code was reading \"EI\" and past it.\n\u003e   Fix this by adding a placeholder value so the inline stream is not\n\u003e   empty. Remove the temporary suppression for this file.\n\u003e - The bug_407752631.in test case can be checked in and will no longer\n\u003e   cause a crash.\n\u003e\n\u003e To deal with malforms images that may not have \"BI\", \"ID\", and \"EI\"\n\u003e operators in that order, do some state tracking so that\n\u003e CPDF_StreamContentParser only looks for \"ID\" and \"EI\" when appropriate,\n\u003e like the existing code.\n\u003e\n\u003e Bug: 407752631\n\u003e Change-Id: Ie14908d8ed72c92c2ae880c18f62469a5cf4eef3\n\u003e Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/130911\n\u003e Commit-Queue: Lei Zhang \u003cthestig@chromium.org\u003e\n\u003e Reviewed-by: Tom Sepez \u003ctsepez@chromium.org\u003e\n\n# Not skipping CQ checks because original CL landed \u003e 1 day ago.\n\nBug: 407752631\nChange-Id: I4860c988fc0cb0fc5b1add9c57b0806378b1e1e6\nReviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/131770\nCommit-Queue: Lei Zhang \u003cthestig@chromium.org\u003e\nReviewed-by: Lei Zhang \u003cthestig@chromium.org\u003e\nBot-Commit: rubber-stamper@appspot.gserviceaccount.com \u003crubber-stamper@appspot.gserviceaccount.com\u003e\n(cherry picked from commit 4d936fae88e88fccdc1422bab23d5b10022a4036)\nReviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/131950\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8e12bef9b8cd19547f252d7cdad6a4fdf34d86f6",
      "old_mode": 33188,
      "old_path": "core/fpdfapi/page/cpdf_streamcontentparser.cpp",
      "new_id": "fdd3ac95769f617ef8dd8e85139f0d5d48ae0dfc",
      "new_mode": 33188,
      "new_path": "core/fpdfapi/page/cpdf_streamcontentparser.cpp"
    },
    {
      "type": "modify",
      "old_id": "a1bc9edefd3f5a6bf76edbcd86cc44d17aae5e50",
      "old_mode": 33188,
      "old_path": "core/fpdfapi/page/cpdf_streamcontentparser.h",
      "new_id": "80b097c00290e366672e4408e21901c57efe742a",
      "new_mode": 33188,
      "new_path": "core/fpdfapi/page/cpdf_streamcontentparser.h"
    },
    {
      "type": "modify",
      "old_id": "7f750ffef9be26aa27f1f9abb7a5a5a57a2748d5",
      "old_mode": 33188,
      "old_path": "core/fpdfapi/page/cpdf_streamparser.cpp",
      "new_id": "4bdfb611616dbe4b3cac1c87e027c2d4a09e23f3",
      "new_mode": 33188,
      "new_path": "core/fpdfapi/page/cpdf_streamparser.cpp"
    },
    {
      "type": "modify",
      "old_id": "a00cc71088f31d2ec5598e28ebd78ab7201c3af8",
      "old_mode": 33188,
      "old_path": "core/fpdfapi/page/cpdf_streamparser.h",
      "new_id": "417f5f2bd9122bbedcf37f996a3ddf2d14e136e5",
      "new_mode": 33188,
      "new_path": "core/fpdfapi/page/cpdf_streamparser.h"
    },
    {
      "type": "modify",
      "old_id": "aa1db925ffaa091cc89d7b9e738d03bd53cda5c4",
      "old_mode": 33188,
      "old_path": "testing/SUPPRESSIONS",
      "new_id": "ae5308a9fe0f9e9ad56d4ce97050e9b67d3642c9",
      "new_mode": 33188,
      "new_path": "testing/SUPPRESSIONS"
    },
    {
      "type": "modify",
      "old_id": "08c11b081166f82aacae6c5df0f05ed7c13b966a",
      "old_mode": 33188,
      "old_path": "testing/resources/pixel/bug_1236805_expected.pdf.0.png",
      "new_id": "7d4eebe3a73d3b353307a96e7309f5cf2916e7d3",
      "new_mode": 33188,
      "new_path": "testing/resources/pixel/bug_1236805_expected.pdf.0.png"
    },
    {
      "type": "delete",
      "old_id": "3993fa43dc85d2340db62ccedb02ec3cf5b4dba5",
      "old_mode": 33188,
      "old_path": "testing/resources/pixel/bug_407752631.in",
      "new_id": "0000000000000000000000000000000000000000",
      "new_mode": 0,
      "new_path": "/dev/null"
    },
    {
      "type": "delete",
      "old_id": "f97e340a54099a4feed1b6a410002dca64a14bc0",
      "old_mode": 33188,
      "old_path": "testing/resources/pixel/bug_407752631_expected.pdf.0.png",
      "new_id": "0000000000000000000000000000000000000000",
      "new_mode": 0,
      "new_path": "/dev/null"
    }
  ]
}
