[shape-plan] Return empty plan if buffer direction is invalid

Happens if buffer creation failed.
This commit is contained in:
Behdad Esfahbod 2022-05-31 08:20:56 -06:00
parent a441c6c16b
commit eba626ff6a
1 changed files with 2 additions and 1 deletions

View File

@ -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;