[aat] Fix two wrongs that made a right before!

Unfortunately our static asserts (DEFINE_SIZE_STATIC) don't actually
fail when used in templates, thanks to SFINAE.  Le sighs.

Probably fixes https://oss-fuzz.com/v2/testcase-detail/5740171484463104
This commit is contained in:
Behdad Esfahbod 2018-10-11 16:41:01 -04:00
parent e940530c97
commit 2c824d3644
2 changed files with 3 additions and 3 deletions

View File

@ -164,7 +164,7 @@ struct LookupFormat4
}
protected:
HBUINT16 format; /* Format identifier--format = 2 */
HBUINT16 format; /* Format identifier--format = 4 */
VarSizedBinSearchArrayOf<LookupSegmentArray<T> >
segments; /* The actual segments. These must already be sorted,
* according to the first word in each one (the last
@ -187,7 +187,7 @@ struct LookupSingle
GlyphID glyph; /* Last GlyphID */
T value; /* The lookup value (only one) */
public:
DEFINE_SIZE_STATIC (4 + T::static_size);
DEFINE_SIZE_STATIC (2 + T::static_size);
};
template <typename T>

View File

@ -833,7 +833,7 @@ struct VarSizedBinSearchArrayOf
{
TRACE_SANITIZE (this);
return_trace (header.sanitize (c) &&
Type::static_size >= header.unitSize &&
Type::static_size <= header.unitSize &&
c->check_array (bytesZ.arrayZ, header.nUnits, header.unitSize));
}