From: Behdad Esfahbod Date: Mon, 16 Aug 2010 18:36:27 +0000 (-0400) Subject: Fix NULL dereference X-Git-Tag: submit/2.0alpha-wayland/20121130.004132~9^2~556 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed4acbde9c5e3323cc95037b500d1bf2878ed3ee;p=profile%2Fivi%2Forg.tizen.video-player.git Fix NULL dereference Reported by Jonathan Kew. Face table handling needs to be redone anyway, but fix this for now. --- diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 31451fc..965a2fb 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -76,19 +76,19 @@ _hb_ot_layout_free (hb_ot_layout_t *layout) static const GDEF& _get_gdef (hb_face_t *face) { - return likely (face->ot_layout->gdef) ? *face->ot_layout->gdef : Null(GDEF); + return likely (face->ot_layout && face->ot_layout->gdef) ? *face->ot_layout->gdef : Null(GDEF); } static const GSUB& _get_gsub (hb_face_t *face) { - return likely (face->ot_layout->gsub) ? *face->ot_layout->gsub : Null(GSUB); + return likely (face->ot_layout && face->ot_layout->gsub) ? *face->ot_layout->gsub : Null(GSUB); } static const GPOS& _get_gpos (hb_face_t *face) { - return likely (face->ot_layout->gpos) ? *face->ot_layout->gpos : Null(GPOS); + return likely (face->ot_layout && face->ot_layout->gpos) ? *face->ot_layout->gpos : Null(GPOS); }