mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-26 01:11:25 +01:00
hb_color_line_get_color_stops() defines *count as in/out: capacity on entry, number of stops written on exit. The skip-to-start early return added in #6121 (to avoid an infinite loop when FT_Get_Colorline_Stops() refuses a stop) writes no stops but left *count untouched, so an embedder paging a malformed ColorLine with start > 0 reads uninitialized hb_color_stop_t entries and draws the gradient from its own buffer. Set *count = 0 on that exit, matching the start >= num_color_stops exit a few lines above and the hb-ot ColorLine::get_color_stops(). Well-formed fonts are unaffected; no API/ABI change. Adds test_color_stops_short_ft with a generated 392-byte font whose ColorLine declares one more stop than it holds. Reported by Anthropic's OSS Scanner as ordinary bug ANT-2026-O5RJ72EZ. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>