Don't serialize null offsets in CPAL.
Fixes https://oss-fuzz.com/testcase-detail/5443213648330752
This commit is contained in:
parent
e29f56354a
commit
dc31920bbe
|
@ -83,8 +83,13 @@ struct CPALV1Tail
|
||||||
auto *out = c->allocate_size<CPALV1Tail> (static_size);
|
auto *out = c->allocate_size<CPALV1Tail> (static_size);
|
||||||
if (unlikely (!out)) return_trace (false);
|
if (unlikely (!out)) return_trace (false);
|
||||||
|
|
||||||
out->paletteFlagsZ.serialize_copy (c, paletteFlagsZ, base, 0, hb_serialize_context_t::Head, palette_count);
|
out->paletteFlagsZ = 0;
|
||||||
out->paletteLabelsZ.serialize_copy (c, paletteLabelsZ, base, 0, hb_serialize_context_t::Head, palette_count);
|
if (paletteFlagsZ)
|
||||||
|
out->paletteFlagsZ.serialize_copy (c, paletteFlagsZ, base, 0, hb_serialize_context_t::Head, palette_count);
|
||||||
|
|
||||||
|
out->paletteLabelsZ = 0;
|
||||||
|
if (paletteLabelsZ)
|
||||||
|
out->paletteLabelsZ.serialize_copy (c, paletteLabelsZ, base, 0, hb_serialize_context_t::Head, palette_count);
|
||||||
|
|
||||||
const hb_array_t<const NameID> colorLabels = (base+colorLabelsZ).as_array (color_count);
|
const hb_array_t<const NameID> colorLabels = (base+colorLabelsZ).as_array (color_count);
|
||||||
if (colorLabelsZ)
|
if (colorLabelsZ)
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue