Alexandre Julliard : wineps: Don't crash on missing loca OTF table.

Alexandre Julliard julliard at winehq.org
Mon Nov 28 14:00:01 CST 2011


Module: wine
Branch: master
Commit: 62cf70d36383aee854db6e775d4fc086f57ca13e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=62cf70d36383aee854db6e775d4fc086f57ca13e

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sat Nov 26 16:29:50 2011 +0100

wineps: Don't crash on missing loca OTF table.

---

 dlls/wineps.drv/type1.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/dlls/wineps.drv/type1.c b/dlls/wineps.drv/type1.c
index fbda3de..01c9c7e 100644
--- a/dlls/wineps.drv/type1.c
+++ b/dlls/wineps.drv/type1.c
@@ -226,11 +226,20 @@ static BOOL get_glyf_pos(HDC hdc, DWORD index, DWORD *start, DWORD *end)
     *start = *end = 0;
 
     len = GetFontData(hdc, MS_MAKE_TAG('h','e','a','d'), 0, NULL, 0);
+    if (len == GDI_ERROR) return FALSE;
     head = HeapAlloc(GetProcessHeap(), 0, len);
     GetFontData(hdc, MS_MAKE_TAG('h','e','a','d'), 0, head, len);
     loca_format = get_be_word(head + 50);
 
     len = GetFontData(hdc, MS_MAKE_TAG('l','o','c','a'), 0, NULL, 0);
+    if (len == GDI_ERROR)
+    {
+        len = GetFontData(hdc, MS_MAKE_TAG('C','F','F',' '), 0, NULL, 0);
+        if (len != GDI_ERROR) FIXME( "CFF tables not supported yet\n" );
+        else ERR( "loca table not found\n" );
+        HeapFree(GetProcessHeap(), 0, head);
+        return FALSE;
+    }
     loca = HeapAlloc(GetProcessHeap(), 0, len);
     GetFontData(hdc, MS_MAKE_TAG('l','o','c','a'), 0, loca, len);
 




More information about the wine-cvs mailing list