[ot-font] Fix hmtx wrong table length check
Discovered by libFuzzer. Ouch! https://github.com/behdad/harfbuzz/issues/139#issuecomment-148289957
This commit is contained in:
parent
613e630617
commit
63ef0b41dc
|
@ -59,7 +59,7 @@ struct hb_ot_face_metrics_accelerator_t
|
||||||
|
|
||||||
this->blob = OT::Sanitizer<OT::_mtx>::sanitize (face->reference_table (_mtx_tag));
|
this->blob = OT::Sanitizer<OT::_mtx>::sanitize (face->reference_table (_mtx_tag));
|
||||||
if (unlikely (!this->num_advances ||
|
if (unlikely (!this->num_advances ||
|
||||||
2 * (this->num_advances + this->num_metrics) < hb_blob_get_length (this->blob)))
|
2 * (this->num_advances + this->num_metrics) > hb_blob_get_length (this->blob)))
|
||||||
{
|
{
|
||||||
this->num_metrics = this->num_advances = 0;
|
this->num_metrics = this->num_advances = 0;
|
||||||
hb_blob_destroy (this->blob);
|
hb_blob_destroy (this->blob);
|
||||||
|
|
Loading…
Reference in New Issue