mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-14 17:13:40 +00:00
[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
1 changed files with 3 additions and 1 deletions
|
@ -228,7 +228,9 @@ struct CFFIndex
|
|||
hb_ubytes_t operator [] (unsigned int index) const
|
||||
{
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue