mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-12-01 18:44:09 +01:00
[raster] Reject empty gradient stop lists
The raster gradient code assumed every color line had at least one stop. Malformed COLR data can report an empty stop list, which then reaches normalize_color_line() and evaluate_color_line() and reads stops[0]. Treat empty color lines as a failed gradient fetch so malformed inputs render nothing instead of dereferencing past the stop array. Tested: - meson compile -C build hb-raster-fuzzer Fixes: https://oss-fuzz.com/testcase-detail/5216672087867392 Assisted-by: OpenAI Codex
This commit is contained in:
1 parent
ef191e9b2c
commit
cb0757aad9
2 files changed
+2
No files matched your search
@@ -849,6 +849,8 @@ get_color_stops (hb_raster_paint_t *c,
|
||||
hb_color_stop_t **stops)
|
||||
{
|
||||
unsigned len = hb_color_line_get_color_stops (color_line, 0, nullptr, nullptr);
|
||||
if (unlikely (!len))
|
||||
return false;
|
||||
if (len > *count)
|
||||
{
|
||||
if (unlikely (!c->scratch_color_stops.resize (len)))
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user