[face] Destroy blob if face closure can not be created (#2490)
This fixes issue #2489.
This commit is contained in:
parent
53b0a183c7
commit
12a9d57292
|
@ -200,10 +200,15 @@ hb_face_create (hb_blob_t *blob,
|
||||||
if (unlikely (!blob))
|
if (unlikely (!blob))
|
||||||
blob = hb_blob_get_empty ();
|
blob = hb_blob_get_empty ();
|
||||||
|
|
||||||
hb_face_for_data_closure_t *closure = _hb_face_for_data_closure_create (hb_sanitize_context_t ().sanitize_blob<OT::OpenTypeFontFile> (hb_blob_reference (blob)), index);
|
blob = hb_sanitize_context_t ().sanitize_blob<OT::OpenTypeFontFile> (hb_blob_reference (blob));
|
||||||
|
|
||||||
|
hb_face_for_data_closure_t *closure = _hb_face_for_data_closure_create (blob, index);
|
||||||
|
|
||||||
if (unlikely (!closure))
|
if (unlikely (!closure))
|
||||||
|
{
|
||||||
|
hb_blob_destroy (blob);
|
||||||
return hb_face_get_empty ();
|
return hb_face_get_empty ();
|
||||||
|
}
|
||||||
|
|
||||||
face = hb_face_create_for_tables (_hb_face_for_data_reference_table,
|
face = hb_face_create_for_tables (_hb_face_for_data_reference_table,
|
||||||
closure,
|
closure,
|
||||||
|
|
Loading…
Reference in New Issue