)]}'
{
  "commit": "a05a48b756de63e3234ea6b3b938b8f5f862484a",
  "tree": "d5fb8c3057818613d9a3bd42e215a2084214f884",
  "parents": [
    "788a624d7387a758ffd5c7ab010f1870dea753a1"
  ],
  "author": {
    "name": "Cosmin Truta",
    "email": "ctruta@gmail.com",
    "time": "Mon Dec 01 22:31:54 2025 +0200"
  },
  "committer": {
    "name": "Cosmin Truta",
    "email": "ctruta@gmail.com",
    "time": "Mon Dec 01 22:31:54 2025 +0200"
  },
  "message": "Finalize the fix for out-of-bounds read in `png_image_read_composite`\n\nFollowing up on commit 788a624d7387a758ffd5c7ab010f1870dea753a1.\n\nThe previous commit added a defensive bounds check to address the\nsecurity issue (out-of-bounds read), but noted that the correctness\nissue remained: when the clamp triggered, the affected pixels were\nclamped to white instead of the correct composited color.\n\nThis commit addresses the correctness issue by fixing the flag\nsynchronization error identified in the previous commit\u0027s TODO:\n\n1. In `png_init_read_transformations`:\n   Clear PNG_FLAG_OPTIMIZE_ALPHA when clearing PNG_COMPOSE for palette\n   images. This correctly signals that the data is sRGB, not linear\n   premultiplied.\n\n2. In `png_image_read_composite`:\n   Check PNG_FLAG_OPTIMIZE_ALPHA and use the appropriate composition\n   formula. When set, use the existing linear composition. When cleared\n   (palette composition already done), use sRGB composition to match\n   what was done to the palette.\n\nRetain the previous clamp to the valid range as belt-and-suspenders\nprotection against any other unforeseen cases.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ab62edd9d820e55c9ebfd220db734064c5257396",
      "old_mode": 33188,
      "old_path": "pngread.c",
      "new_id": "f8ca2b7e31d05de40e5c7edfa5675c74208c1b35",
      "new_mode": 33188,
      "new_path": "pngread.c"
    },
    {
      "type": "modify",
      "old_id": "2f5202255158dd5bfbc3cb6c2a2d79a66c8e4200",
      "old_mode": 33188,
      "old_path": "pngrtran.c",
      "new_id": "507d11381ec049eb88d964b05e3fab161f33740c",
      "new_mode": 33188,
      "new_path": "pngrtran.c"
    }
  ]
}
