diff --git a/src/hb-raster-paint.cc b/src/hb-raster-paint.cc index 84657cdd6..a3e508e00 100644 --- a/src/hb-raster-paint.cc +++ b/src/hb-raster-paint.cc @@ -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))) diff --git a/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-raster-fuzzer-5216672087867392 b/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-raster-fuzzer-5216672087867392 new file mode 100644 index 000000000..a7b5a77de Binary files /dev/null and b/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-raster-fuzzer-5216672087867392 differ