[Coverage/ClassDef] Handle glyphID overflow in serialize

This commit is contained in:
Behdad Esfahbod committed 2023-05-07 15:49:50 -06:00
1 parent 6d7de2f8dd
commit 8df5cdbcda
2 files changed
+15 -1

No files matched your search

+7
View File
@@ -132,7 +132,14 @@ struct Coverage
#ifndef HB_NO_BEYOND_64K
if (max > 0xFFFFu)
u.format += 2;
if (unlikely (max > 0xFFFFFFu))
#else
if (unlikely (max > 0xFFFFu))
#endif
{
c->check_success (false, HB_SERIALIZE_ERROR_INT_OVERFLOW);
return_trace (false);
}
switch (u.format)
{
+8 -1
View File
@@ -2101,8 +2101,15 @@ struct ClassDef
#ifndef HB_NO_BEYOND_64K
if (glyph_max > 0xFFFFu)
format += 2;
u.format += 2;
if (unlikely (glyph_max > 0xFFFFFFu))
#else
if (unlikely (glyph_max > 0xFFFFu))
#endif
{
c->check_success (false, HB_SERIALIZE_ERROR_INT_OVERFLOW);
return_trace (false);
}
u.format = format;