[uniscribe] Handle E_NOT_SUFFICIENT_BUFFER as well as E_OUTOFMEMORY
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 17 Dec 2015 16:57:47 +0000 (16:57 +0000)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 17 Dec 2015 17:28:35 +0000 (17:28 +0000)
On Windows 10 we are seeing that other error message...

Test sequence: U+0995,U+-9CD,U+09B0
With Nirmala shipped on Windows 10, this failed to form the below form.
Works now.

Reported by Sairus.

src/hb-uniscribe.cc

index 01be0cc..86bb84f 100644 (file)
@@ -919,7 +919,7 @@ retry:
 
     if (unlikely (items[i].a.fNoGlyphIndex))
       FAIL ("ScriptShapeOpenType() set fNoGlyphIndex");
-    if (unlikely (hr == E_OUTOFMEMORY))
+    if (unlikely (hr == E_OUTOFMEMORY || hr == E_NOT_SUFFICIENT_BUFFER))
     {
       if (unlikely (!buffer->ensure (buffer->allocated * 2)))
        FAIL ("Buffer resize failed");