[fvar] Rewrite sanitize

This commit is contained in:
Behdad Esfahbod 2018-11-19 13:09:53 -05:00
parent 4a6a692e3e
commit 56c9238d3d

View File

@ -101,12 +101,10 @@ struct fvar
return_trace (version.sanitize (c) &&
likely (version.major == 1) &&
c->check_struct (this) &&
axisSize == 20 && /* Assumed in our code. */
instanceSize >= axisCount * 4 + 4 &&
axisSize <= 1024 && /* Arbitrary, just to simplify overflow checks. */
instanceSize <= 1024 && /* Arbitrary, just to simplify overflow checks. */
c->check_range (this, firstAxis) &&
c->check_range (&StructAtOffset<char> (this, firstAxis),
axisCount * axisSize + instanceCount * instanceSize));
get_axes ().sanitize (c) &&
c->check_range (get_first_instance (), instanceCount, instanceSize));
}
inline unsigned int get_axis_count (void) const