)]}'
{
  "commit": "828c40cdf1308de36f1ac46f9e49afdb86140f8f",
  "tree": "ced909db7f9eccb1b345cb98168e2d0db223d3d7",
  "parents": [
    "922614d6fe92530fc11c188077c4c456405e09d2"
  ],
  "author": {
    "name": "Marvin Scholz",
    "email": "marvinscholz@xwf.google.com",
    "time": "Thu Nov 26 21:52:32 2026 +0000"
  },
  "committer": {
    "name": "Lin Zheng",
    "email": "linzhen@google.com",
    "time": "Thu Dec 03 16:26:38 2026 -0800"
  },
  "message": "Clamp bit allocations in the two-pass rate control\n\ncalculate_boost_bits() and allocate_gf_group_bits() cast a 64-bit bit\ncount to int without checking that it fits. With a high target bitrate\nand a low frame rate the value exceeds INT_MAX and the cast wraps.\n\nFor example, with a target bitrate of 2000000 kbps at one frame per\nsecond and 4 frames, calculate_boost_bits() computes 5333333333 bits\nfor the key frame, which wraps to 1038366037. That leaves a group\nbudget of 6961633963 bits for the remaining 3 frames, and\nbase_frame_bits in allocate_gf_group_bits() becomes -1974422642.\n\nThe negative value is stored in gf_group-\u003ebit_allocation[] and becomes\nrc-\u003ebase_frame_target and rc-\u003ethis_frame_target. UBSan then reports:\n\n  pass2_strategy.c: runtime error: signed integer overflow:\n  2147483647 - -1974422642 cannot be represented in type \u0027int\u0027\n  ratectrl.c: runtime error: left shift of negative value -987211321\n\nClamp both values to [0, INT_MAX] before the cast.\n\nChange-Id: I53ed5e94256450d9a7269701f0b0fc07265eb727\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e516d6d7dddd1d08ffe96dc494c858e32c950e9d",
      "old_mode": 33188,
      "old_path": "av1/encoder/pass2_strategy.c",
      "new_id": "95bd338ec7b334ca832a625b8659dbc33a31b7fe",
      "new_mode": 33188,
      "new_path": "av1/encoder/pass2_strategy.c"
    }
  ]
}
