[hb-old] Fixup not-enough-space handling
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 25 Jul 2012 23:22:57 +0000 (19:22 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 25 Jul 2012 23:22:57 +0000 (19:22 -0400)
src/hb-old.cc

index e828ca8..be0187f 100644 (file)
@@ -329,14 +329,15 @@ retry:
 #undef ALLOCATE_ARRAY
 
   if (!HB_ShapeItem (&item))
-    return false;
-
-  if (unlikely (item.num_glyphs > num_glyphs))
   {
-    buffer->ensure (buffer->allocated * 2);
-    if (buffer->in_error)
-      FAIL ("Buffer resize failed");
-    goto retry;
+    if (unlikely (item.num_glyphs > num_glyphs))
+    {
+      buffer->ensure (buffer->allocated * 2);
+      if (buffer->in_error)
+       FAIL ("Buffer resize failed");
+      goto retry;
+    }
+    return false;
   }
   num_glyphs = item.num_glyphs;