[CFF] Fix parsing of empty Index

https://github.com/harfbuzz/harfbuzz/issues/3545#issuecomment-1111047941
This commit is contained in:
Behdad Esfahbod 2022-04-27 12:38:35 -06:00
parent 6454cec085
commit d8292b8446
1 changed files with 1 additions and 1 deletions

View File

@ -284,7 +284,7 @@ struct CFFIndex
bool sanitize (hb_sanitize_context_t *c) const bool sanitize (hb_sanitize_context_t *c) const
{ {
TRACE_SANITIZE (this); TRACE_SANITIZE (this);
return_trace (likely ((c->check_struct (this) && count == 0) || /* empty INDEX */ return_trace (likely ((c->check_struct (&count) && count == 0) || /* empty INDEX */
(c->check_struct (this) && offSize >= 1 && offSize <= 4 && (c->check_struct (this) && offSize >= 1 && offSize <= 4 &&
c->check_array (offsets, offSize, count + 1) && c->check_array (offsets, offSize, count + 1) &&
c->check_array ((const HBUINT8*) data_base (), 1, max_offset () - 1)))); c->check_array ((const HBUINT8*) data_base (), 1, max_offset () - 1))));