From 73c6dcbb45269186f204b2212288b6384ce42c9d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 7 Feb 2017 16:53:21 -0800 Subject: [PATCH] Silence Coverity warning Fixes https://github.com/behdad/harfbuzz/issues/408 --- src/hb-ot-shape-complex-arabic.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc index 56ec5cd65..57ffc1dc5 100644 --- a/src/hb-ot-shape-complex-arabic.cc +++ b/src/hb-ot-shape-complex-arabic.cc @@ -540,7 +540,7 @@ apply_stch (const hb_ot_shape_plan_t *plan, /* See if we can improve the fit by adding an extra repeat and squeezing them together a bit. */ hb_position_t extra_repeat_overlap = 0; hb_position_t shortfall = sign * w_remaining - sign * w_repeating * (n_copies + 1); - if (shortfall > 0) + if (shortfall > 0 && n_repeating > 0) { ++n_copies; hb_position_t excess = (n_copies + 1) * sign * w_repeating - sign * w_remaining;