)]}'
{
  "commit": "d65aa90ea656aa1e31ff26b7d052ef2eaa1f418a",
  "tree": "854e51c5d08ebe698498e6591271498a64a55e34",
  "parents": [
    "cce964cb4f3f29a9addbb079b52c7a712fba93b8"
  ],
  "author": {
    "name": "Hanyu Wang",
    "email": "u3629001@connect.hku.hk",
    "time": "Fri Jul 24 14:35:58 2026 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri Jul 24 15:35:58 2026 -0600"
  },
  "message": "[buffer] Set content_type only for the format actually being parsed (#6092)\n\nhb_buffer_deserialize_unicode() and hb_buffer_deserialize_glyphs() each\nmutated the buffer\u0027s content_type unconditionally before checking\nwhether the caller-supplied format was recognized, then returned false\nwithout rolling that back for an invalid format. A buffer left with\ncontent_type set but len \u003d\u003d 0 fails the assert_glyphs() /\nassert_unicode() invariant on a later, independent call that expects\na clean buffer, aborting the process:\n\n  - deserialize_unicode(INVALID) -\u003e deserialize_glyphs() aborts in\n    assert_glyphs().\n  - deserialize_glyphs(INVALID) -\u003e add_codepoints() aborts in\n    assert_unicode().\n\nMove each hb_buffer_set_content_type() call into the TEXT/JSON case\nbodies of the existing format switch, instead of guarding it with a\nseparate validity check ahead of the switch. The switch\u0027s own case\nlist is already the single source of truth for which formats are\nsupported, so this avoids duplicating that knowledge in a second\ncondition that could drift out of sync with the switch.\n\nTesting:\n  - Built with -Db_sanitize\u003daddress,undefined.\n  - Reproduced both original aborts against the unfixed code\n    (SIGABRT via assert_glyphs()/assert_unicode()).\n  - Rebuilt with the fix and reran both reproducers: clean exit, no\n    assertion failure.\n  - Ran the full test suite (meson test, sanitizer build, FreeType +\n    ICU enabled) before and after: 71/75 pass in both, with the same\n    4 pre-existing failures unrelated to buffer serialization\n    (check-libstdc++, and the experimental vector/raster/gpu-fuzzer\n    chunk 2 targets) - confirmed to fail identically on the\n    unmodified baseline, so no regressions from this change.\n\nAssisted-by: Claude Sonnet 5 \u003cnoreply@anthropic.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "923524d708ae23146b27b637f87c179d988b2b44",
      "old_mode": 33188,
      "old_path": "src/hb-buffer-serialize.cc",
      "new_id": "3aa48b69b4559ff7f9bab92794345664126e8be5",
      "new_mode": 33188,
      "new_path": "src/hb-buffer-serialize.cc"
    }
  ]
}
