From cec6611c5ce84d69d910bf7e9ec1fdd594398f9f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 2 May 2011 20:18:58 -0400 Subject: [PATCH] Protect NULL in a couple places --- src/hb-font.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hb-font.cc b/src/hb-font.cc index 91dde45..2de3950 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -312,7 +312,7 @@ hb_face_create_for_tables (hb_get_table_func_t get_table, { hb_face_t *face; - if (!(face = hb_object_create ())) { + if (!get_table || !(face = hb_object_create ())) { if (destroy) destroy (user_data); return &_hb_face_nil; @@ -379,7 +379,7 @@ hb_face_t * hb_face_create_for_data (hb_blob_t *blob, unsigned int index) { - if (unlikely (hb_object_is_inert (blob))) + if (unlikely (!blob || hb_object_is_inert (blob))) return &_hb_face_nil; hb_face_for_data_closure_t *closure = _hb_face_for_data_closure_create (Sanitizer::sanitize (hb_blob_reference (blob)), index); @@ -434,7 +434,7 @@ hb_face_get_user_data (hb_face_t *face, hb_blob_t * hb_face_reference_table (hb_face_t *face, - hb_tag_t tag) + hb_tag_t tag) { hb_blob_t *blob; -- 2.7.4