From 3dcbdc2125c04c173f29f04922fc031929893f4e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 30 Jul 2012 19:31:17 -0400 Subject: [PATCH] Minor --- src/hb-ot-layout.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 1e5787496..28c2f8325 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -42,17 +42,12 @@ HB_SHAPER_DATA_ENSURE_DECLARE(ot, face) -static hb_bool_t -hb_ot_layout_ensure (hb_face_t *face) -{ - return hb_ot_shaper_face_data_ensure (face); -} - - hb_ot_layout_t * _hb_ot_layout_create (hb_face_t *face) { hb_ot_layout_t *layout = (hb_ot_layout_t *) calloc (1, sizeof (hb_ot_layout_t)); + if (unlikely (!layout)) + return NULL; layout->gdef_blob = Sanitizer::sanitize (hb_face_reference_table (face, HB_OT_TAG_GDEF)); layout->gdef = Sanitizer::lock_instance (layout->gdef_blob); @@ -79,19 +74,19 @@ _hb_ot_layout_destroy (hb_ot_layout_t *layout) static inline const GDEF& _get_gdef (hb_face_t *face) { - if (unlikely (!hb_ot_layout_ensure (face))) return Null(GDEF); + if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(GDEF); return *hb_ot_layout_from_face (face)->gdef; } static inline const GSUB& _get_gsub (hb_face_t *face) { - if (unlikely (!hb_ot_layout_ensure (face))) return Null(GSUB); + if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(GSUB); return *hb_ot_layout_from_face (face)->gsub; } static inline const GPOS& _get_gpos (hb_face_t *face) { - if (unlikely (!hb_ot_layout_ensure (face))) return Null(GPOS); + if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(GPOS); return *hb_ot_layout_from_face (face)->gpos; }