)]}'
{
  "commit": "3454230543d5d50ef95a5a89c15b2206c70a4dca",
  "tree": "e9a4c9fead75c550a13407880032976a1fc5f7c5",
  "parents": [
    "1b33fd5098c6e7b58324146b8f5518cbb4cdfb72"
  ],
  "author": {
    "name": "Richard Geldreich",
    "email": "richgel99@protonmail.com",
    "time": "Sat Jul 18 16:47:58 2026 -0400"
  },
  "committer": {
    "name": "Richard Geldreich",
    "email": "richgel99@protonmail.com",
    "time": "Sat Jul 18 16:47:58 2026 -0400"
  },
  "message": "KTX2: overflow-safe range checks and input bounds in ktx2_transcoder::init\n\nThe KTX2 level and supercompression-global-data (SGD) offset/length\nfields are full 64-bit values read from the file. init() validated them\nwith \"offset + length \u003e m_data_size\", where the addition can wrap around\nand incorrectly pass for out-of-range values. Rewrite both checks as\n\"offset \u003e m_data_size || length \u003e (uint64_t)m_data_size - offset\", which\ncannot overflow (offset is confirmed \u003c\u003d m_data_size before the\nsubtraction, so it can\u0027t underflow either). The result is identical to\nthe original for every in-range input.\n\nAlso in init():\n- Reject a level whose byte_length is 0. This case already logged an\n  error but fell through without returning false.\n- Add KTX2_MAX_SUPPORTED_LAYER_COUNT (65535) and reject files whose\n  layer_count exceeds it, mirroring KTX2_MAX_SUPPORTED_LEVEL_COUNT, so\n  layer_count * face_count * level_count stays bounded.\n\nread_slice_offset_len_global_data(): compute image_count in 64-bit,\nverify m_sgd_byte_length \u003d\u003d image_count * descriptor_size before sizing\nthe descriptor array, and use try_resize() (returns false on failure)\ninstead of resize() (which aborts the process) so an out-of-range count\nfails cleanly instead of attempting an oversized allocation. Also\ncompute image_count in 64-bit in decompress_etc1s_global_data().\n\nValid files are handled exactly as before.\n\nCo-Authored-By: Claude Opus 4.8 \u003cnoreply@anthropic.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2f96b52b6523dc09b2698770a2f6601bbac310f3",
      "old_mode": 33188,
      "old_path": "transcoder/basisu_transcoder.cpp",
      "new_id": "721d298c6d34df187deee47d5b81b037b752d80c",
      "new_mode": 33188,
      "new_path": "transcoder/basisu_transcoder.cpp"
    },
    {
      "type": "modify",
      "old_id": "a3176136363258ddd74f8c320bf24db1610ad479",
      "old_mode": 33188,
      "old_path": "transcoder/basisu_transcoder.h",
      "new_id": "4a961cd46d567a38da3034c3fea636eb2a1adde0",
      "new_mode": 33188,
      "new_path": "transcoder/basisu_transcoder.h"
    }
  ]
}
