[unsafe-to-break] Fix Use-of-uninitialized-value in unsafe_to_break_set_mask
authorBehdad Esfahbod <behdad@behdad.org>
Fri, 11 Aug 2017 18:30:39 +0000 (11:30 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Fri, 11 Aug 2017 18:30:39 +0000 (11:30 -0700)
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3011

src/hb-ot-shape-complex-hangul.cc

index a90af3f..0e74802 100644 (file)
@@ -372,7 +372,7 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan,
            buffer->merge_out_clusters (start, end);
          continue;
        }
-       else if (!tindex)
+       else if ((!tindex && buffer->idx + 1 < count && isT (buffer->cur(+1).codepoint)))
          buffer->unsafe_to_break (buffer->idx, buffer->idx + 2); /* Mark unsafe between LV and T. */
       }