From eba626ff6a2cbf92ddff267633ba1b7e5cb9540c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 31 May 2022 08:20:56 -0600 Subject: [PATCH] [shape-plan] Return empty plan if buffer direction is invalid Happens if buffer creation failed. --- src/hb-shape-plan.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hb-shape-plan.cc b/src/hb-shape-plan.cc index 66332165c..4c79e9cac 100644 --- a/src/hb-shape-plan.cc +++ b/src/hb-shape-plan.cc @@ -231,7 +231,8 @@ hb_shape_plan_create2 (hb_face_t *face, num_coords, shaper_list); - assert (props->direction != HB_DIRECTION_INVALID); + if (unlikely (props->direction == HB_DIRECTION_INVALID)) + return hb_shape_plan_get_empty (); hb_shape_plan_t *shape_plan;