)]}'
{
  "commit": "193e1126881da56f10c6dac4a4bb327312be729c",
  "tree": "4de5b0ba3d2a18f5873077d46af66cc2546a1bc0",
  "parents": [
    "88d82a1dfff173906c1218917d9a266c1c2e7020"
  ],
  "author": {
    "name": "Nico Weber",
    "email": "thakis@chromium.org",
    "time": "Tue Oct 14 10:33:54 2025 -0700"
  },
  "committer": {
    "name": "Pdfium LUCI CQ",
    "email": "pdfium-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Tue Oct 14 10:33:54 2025 -0700"
  },
  "message": "Undo incorrect arithmetic decoder change + follow-up\n\nReverts https://pdfium-review.googlesource.com/c/pdfium/+/52712\nReverts https://pdfium-review.googlesource.com/c/pdfium/+/16791\n\nThe last of those two is incorrect per JBIG2 spec, the first papers\nover an issue caused by it.\n\nThe last change even cites the spec part that says that an arithmetic\ndecoder should keep returning 1-bits on out-of-data. This is also\ndescribed in detail in Annex E.\n\nThis includes two tests, one of which has several trailing 7fff\nbyte pairs stripped before the final ffac pair. pdf.js, Preview.app,\nAcrobat Reader all decode these files fine.\n\nThe construction of these tests is described in detail in:\n* https://github.com/SerenityOS/serenity/pull/26272/commits/ba49ffac4dd\n* https://github.com/SerenityOS/serenity/pull/26242/commits/9882a8462b6\n\nI took these two files, converted them to PDF using Meta/jbig2_to_pdf.py\nin that repo, and then to .in format using the script in\nhttps://pdfium-review.googlesource.com/c/pdfium/+/136590\n\nThis also fixes decoding 042_25.jb2 from the Power JBIG2 test set.\n\nclusterfuzz-testcase-pdf_codec_jbig2_fuzzer-5210024078213120 from\nthe third linked bug is a 5636 x 60419 image and needs ~35s to\nrun on my machine. To not re-introduce the timeouts fixed by the\nincorrect fix, instead limit regions to 4096 x 4096 while fuzzing.\nThis makes `pdf_codec_jbig2_fuzzer` process that test case in\n0 ms instead of in 35s on my machine as it now early-outs.\n\nI confirmed that bug_947622_min.pdf from comment 7 on\nbug 41450095 renders exactly the same before and after this change.\n\nBug: 432920906,41450095,40540933\nChange-Id: Idc5c13c9440d0b4749f0832659bcdf36c1bc3597\nReviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/136630\nReviewed-by: Nico Weber \u003cthakis@google.com\u003e\nCommit-Queue: Nico Weber \u003cthakis@chromium.org\u003e\nReviewed-by: Lei Zhang \u003cthestig@chromium.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "dbc9a8ec212ead2b689f5df856dc70315a141bf5",
      "old_mode": 33188,
      "old_path": "core/fpdfapi/page/cpdf_dib.cpp",
      "new_id": "deb642634858dd24ade55e039aefba69d1cb0aeb",
      "new_mode": 33188,
      "new_path": "core/fpdfapi/page/cpdf_dib.cpp"
    },
    {
      "type": "modify",
      "old_id": "b25b5579bcced6c79deda2263348cc62c2b29051",
      "old_mode": 33188,
      "old_path": "core/fxcodec/jbig2/JBig2_ArithDecoder.cpp",
      "new_id": "1c4a0d28997b5864086c20ddc730c79f765d8b30",
      "new_mode": 33188,
      "new_path": "core/fxcodec/jbig2/JBig2_ArithDecoder.cpp"
    },
    {
      "type": "modify",
      "old_id": "4d3ff12547d5644a28939f017ea6815f1c16dc7f",
      "old_mode": 33188,
      "old_path": "core/fxcodec/jbig2/JBig2_ArithDecoder.h",
      "new_id": "a103508cb8cf150c2de7668f48f9088d95d20773",
      "new_mode": 33188,
      "new_path": "core/fxcodec/jbig2/JBig2_ArithDecoder.h"
    },
    {
      "type": "modify",
      "old_id": "827386ddbfa52575d3d6dcf95ae3702776ae2a39",
      "old_mode": 33188,
      "old_path": "core/fxcodec/jbig2/JBig2_Context.cpp",
      "new_id": "2d62067e44b8effb0d6ac88d315000f69c3ef3c0",
      "new_mode": 33188,
      "new_path": "core/fxcodec/jbig2/JBig2_Context.cpp"
    },
    {
      "type": "modify",
      "old_id": "b7521e50291f33177b93aa4c89a9bb80f534769d",
      "old_mode": 33188,
      "old_path": "core/fxcodec/jbig2/JBig2_Context.h",
      "new_id": "fb967f29184a0e703fd28f7b63b8338b27d9faa4",
      "new_mode": 33188,
      "new_path": "core/fxcodec/jbig2/JBig2_Context.h"
    },
    {
      "type": "modify",
      "old_id": "d195525c96fa174ff79fb38f39881307cabd6ead",
      "old_mode": 33188,
      "old_path": "core/fxcodec/jbig2/jbig2_decoder.cpp",
      "new_id": "f64f06525691427762fce36278b0531a25dd3933",
      "new_mode": 33188,
      "new_path": "core/fxcodec/jbig2/jbig2_decoder.cpp"
    },
    {
      "type": "modify",
      "old_id": "d068842e7ea09e8bbe91bd4efc491966ec5844ee",
      "old_mode": 33188,
      "old_path": "core/fxcodec/jbig2/jbig2_decoder.h",
      "new_id": "96e3685fa302f91113d6fe4ad854a121929f3edf",
      "new_mode": 33188,
      "new_path": "core/fxcodec/jbig2/jbig2_decoder.h"
    },
    {
      "type": "modify",
      "old_id": "e28d63065c5fd350218a08e78e30da8859ac7ca0",
      "old_mode": 33188,
      "old_path": "testing/fuzzers/pdf_codec_jbig2_fuzzer.cc",
      "new_id": "91a4eaccf662a82ae85b496795b6a55404062c3d",
      "new_mode": 33188,
      "new_path": "testing/fuzzers/pdf_codec_jbig2_fuzzer.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "cb2d1ba499fd833847782c383469681bbc4d1f49",
      "new_mode": 33188,
      "new_path": "testing/resources/pixel/jbig2-trailing-7fff-stripped-harder-refine.in"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "02f6c0d391cd94ae8fa77ceec14e5798919a09e2",
      "new_mode": 33188,
      "new_path": "testing/resources/pixel/jbig2-trailing-7fff-stripped-harder-refine_expected.pdf.0.png"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "c5668ae82f0419514a751edb6aea54fd632a1006",
      "new_mode": 33188,
      "new_path": "testing/resources/pixel/jbig2-trailing-7fff-stripped-harder.in"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "02f6c0d391cd94ae8fa77ceec14e5798919a09e2",
      "new_mode": 33188,
      "new_path": "testing/resources/pixel/jbig2-trailing-7fff-stripped-harder_expected.pdf.0.png"
    }
  ]
}
