)]}'
{
  "commit": "3e9371f563a6bd96440b0e3d425afdc1f91c7f45",
  "tree": "8e62ee3cd580bd462b66658915464abb9834f99f",
  "parents": [
    "257b1e45f979491d905786d80691ba33a7597290"
  ],
  "author": {
    "name": "Anthony Hurtado",
    "email": "amhurtado@protonmail.com",
    "time": "Wed May 13 06:07:40 2026 -0500"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed May 13 13:07:40 2026 +0200"
  },
  "message": "Fix NaN bypass of AVIF_CLAMP in gain map pixel clamping (#3189)\n\nApply path (the two sites at lines 156 and 277): when `baseLinear + baseOffset` is zero (e.g., a black pixel with `baseOffset \u003d {0, 1}`), and the gain map log2 value is large enough for `exp2f()` to overflow to +Inf, the multiplication `0.0f * +Inf` evaluates to NaN per IEEE 754. The NaN then passes through `linearToGamma()` and `AVIF_CLAMP()` unmodified, since the macro\u0027s ternary comparisons all return false for NaN operands.\n\nA similar NaN path exists in the compute path (line 764): if `base + baseOffset[c]` is near-zero after color space conversion, the ratio at line 695 overflows to +Inf. `AVIF_MAX(ratio, kEpsilon)` only lower-bounds, so +Inf passes through into `gainMapF`. After `avifFindMinMaxWithoutOutliers` picks up +Inf as the channel max, the normalization `(+Inf - min) / +Inf` evaluates to NaN (indeterminate form).\n\nThe `fminf`/`fmaxf` fix is intentionally a safety net at the output boundary — it ensures NaN can\u0027t reach `avifSetRGBAPixel()` regardless of which upstream path produced it. If you\u0027d prefer a root-cause fix as well (e.g., clamping the ratio or guarding `exp2f` overflow), I\u0027m happy to add that.\n\nCo-authored-by: Claude Opus 4.6 \u003cnoreply@anthropic.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "17349e754547b040c8a75b2b106d17b4a07cf33e",
      "old_mode": 33188,
      "old_path": "CHANGELOG.md",
      "new_id": "7b3b942546e4c8d6a8ffadaecefa7e90762e0e84",
      "new_mode": 33188,
      "new_path": "CHANGELOG.md"
    },
    {
      "type": "modify",
      "old_id": "40a332fc2fa8a31d6e64d2868f087a9ec92bfd32",
      "old_mode": 33188,
      "old_path": "src/gainmap.c",
      "new_id": "f56484d4355ba6f1948ca476215aedb53eff21b4",
      "new_mode": 33188,
      "new_path": "src/gainmap.c"
    },
    {
      "type": "modify",
      "old_id": "8abd2265b060ad198aede53ddc9a6033f158c1ba",
      "old_mode": 33188,
      "old_path": "tests/gtest/avifgainmaptest.cc",
      "new_id": "9f6cdd5e6ec80c3216c1ac511abdc202468e9119",
      "new_mode": 33188,
      "new_path": "tests/gtest/avifgainmaptest.cc"
    }
  ]
}
