[Libreoffice-commits] core.git: Branch 'aoo/trunk' - vcl/source

Herbert Dürr hdu at apache.org
Fri Oct 4 09:08:07 PDT 2013


 vcl/source/fontsubset/sft.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit d519b07ecd4b67cedf1fe3e1860ef33a48a01ae4
Author: Herbert Dürr <hdu at apache.org>
Date:   Fri Oct 4 15:14:22 2013 +0000

    #i123417# handle subsetting of empty ttf compound glyphs gracefully

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index d40cbda..cc69585 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -799,7 +799,10 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
 
     } while (flags & MORE_COMPONENTS);
 
-
+    // #i123417# some fonts like IFAOGrec have no outline points in some compound glyphs
+    // so this unlikely but possible scenario should be handled gracefully
+    if( myPoints.empty() )
+        return 0;
 
     np = myPoints.size();
 
@@ -2787,7 +2790,7 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID)
     /* now calculate npoints and ncontours */
     ControlPoint *cp;
     n = GetTTGlyphPoints(ttf, glyphID, &cp);
-    if (n != -1) {
+    if( n > 0) {
         m = 0;
         for (i = 0; i < n; i++) {
             if (cp[i].flags & 0x8000) m++;


More information about the Libreoffice-commits mailing list