[gvar] Handle a couple of error conditions
This commit is contained in:
parent
b7e9e8785c
commit
ab15fe082a
|
@ -598,13 +598,11 @@ struct gvar
|
||||||
bool apply_to_all = (indices.length == 0);
|
bool apply_to_all = (indices.length == 0);
|
||||||
unsigned int num_deltas = apply_to_all ? points.length : indices.length;
|
unsigned int num_deltas = apply_to_all ? points.length : indices.length;
|
||||||
hb_vector_t<int> x_deltas;
|
hb_vector_t<int> x_deltas;
|
||||||
x_deltas.resize (num_deltas);
|
if (unlikely (!x_deltas.resize (num_deltas))) return false;
|
||||||
if (!GlyphVariationData::unpack_deltas (p, x_deltas, end))
|
if (unlikely (!GlyphVariationData::unpack_deltas (p, x_deltas, end))) return false;
|
||||||
return false;
|
|
||||||
hb_vector_t<int> y_deltas;
|
hb_vector_t<int> y_deltas;
|
||||||
y_deltas.resize (num_deltas);
|
if (unlikely (!y_deltas.resize (num_deltas))) return false;
|
||||||
if (!GlyphVariationData::unpack_deltas (p, y_deltas, end))
|
if (unlikely (!GlyphVariationData::unpack_deltas (p, y_deltas, end))) return false;
|
||||||
return false;
|
|
||||||
|
|
||||||
for (unsigned int i = 0; i < deltas.length; i++)
|
for (unsigned int i = 0; i < deltas.length; i++)
|
||||||
deltas[i].init ();
|
deltas[i].init ();
|
||||||
|
|
Loading…
Reference in New Issue