[cff-common] In INDEX, return empty bytes if length is zero
Before it was possible to return non-null arrayZ.
This commit is contained in:
parent
a2f132f1fc
commit
2d2f66e1a3
|
@ -228,7 +228,9 @@ struct CFFIndex
|
||||||
hb_ubytes_t operator [] (unsigned int index) const
|
hb_ubytes_t operator [] (unsigned int index) const
|
||||||
{
|
{
|
||||||
if (unlikely (index >= count)) return hb_ubytes_t ();
|
if (unlikely (index >= count)) return hb_ubytes_t ();
|
||||||
return hb_ubytes_t (data_base () + offset_at (index) - 1, length_at (index));
|
unsigned length = length_at (index);
|
||||||
|
if (unlikely (!length)) return hb_ubytes_t ();
|
||||||
|
return hb_ubytes_t (data_base () + offset_at (index) - 1, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int get_size () const
|
unsigned int get_size () const
|
||||||
|
|
Loading…
Reference in New Issue