Protect NULL in a couple places
This commit is contained in:
parent
5a5030366e
commit
cec6611c5c
|
@ -312,7 +312,7 @@ hb_face_create_for_tables (hb_get_table_func_t get_table,
|
||||||
{
|
{
|
||||||
hb_face_t *face;
|
hb_face_t *face;
|
||||||
|
|
||||||
if (!(face = hb_object_create<hb_face_t> ())) {
|
if (!get_table || !(face = hb_object_create<hb_face_t> ())) {
|
||||||
if (destroy)
|
if (destroy)
|
||||||
destroy (user_data);
|
destroy (user_data);
|
||||||
return &_hb_face_nil;
|
return &_hb_face_nil;
|
||||||
|
@ -379,7 +379,7 @@ hb_face_t *
|
||||||
hb_face_create_for_data (hb_blob_t *blob,
|
hb_face_create_for_data (hb_blob_t *blob,
|
||||||
unsigned int index)
|
unsigned int index)
|
||||||
{
|
{
|
||||||
if (unlikely (hb_object_is_inert (blob)))
|
if (unlikely (!blob || hb_object_is_inert (blob)))
|
||||||
return &_hb_face_nil;
|
return &_hb_face_nil;
|
||||||
|
|
||||||
hb_face_for_data_closure_t *closure = _hb_face_for_data_closure_create (Sanitizer<OpenTypeFontFile>::sanitize (hb_blob_reference (blob)), index);
|
hb_face_for_data_closure_t *closure = _hb_face_for_data_closure_create (Sanitizer<OpenTypeFontFile>::sanitize (hb_blob_reference (blob)), index);
|
||||||
|
|
Loading…
Reference in New Issue