[Libreoffice-commits] core.git: 2 commits - vcl/source

Herbert Dürr hdu at apache.org
Thu Mar 7 03:28:25 PST 2013


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

New commits:
commit be5587ce0c13901acffe664d71bf22f0cb60918a
Author: Herbert Dürr <hdu at apache.org>
Date:   Thu Jun 14 08:42:47 2012 +0000

    c#705440# check ftell return value when emitting Type1 subset
    
    Conflicts:
    	vcl/source/fontsubset/cff.cxx
    
    Change-Id: Idaf328b48a55fbcef13746f74120c13b6b435c93

diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index dabc634..43e397c 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -1920,10 +1920,11 @@ size_t Type1Emitter::updateLen( int nTellPos, size_t nLength)
     cData[1] = static_cast<U8>(nLength >>  8);
     cData[2] = static_cast<U8>(nLength >> 16);
     cData[3] = static_cast<U8>(nLength >> 24);
-    const int nCurrPos = ftell( mpFileOut);
+    const long nCurrPos = ftell( mpFileOut);
     fseek( mpFileOut, nTellPos, SEEK_SET);
     size_t nWrote = fwrite( cData, 1, sizeof(cData), mpFileOut);
-    fseek( mpFileOut, nCurrPos, SEEK_SET);
+    if( nCurrPos >= 0)
+        fseek( mpFileOut, nCurrPos, SEEK_SET);
     return nWrote;
 }
 
commit ce740afe80a3230dd66b820f428467b82b89dee2
Author: Herbert Dürr <hdu at apache.org>
Date:   Thu Jun 14 08:32:39 2012 +0000

    c#705441# handle invalid FDSelect entry while emitting Type1
    
    Change-Id: I1865eec0dcb29c74e98a6f42f7cf37a2851f8e85

diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx
index 55e5897..dabc634 100644
--- a/vcl/source/fontsubset/cff.cxx
+++ b/vcl/source/fontsubset/cff.cxx
@@ -2257,6 +2257,8 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter,
         assert( (nGlyphId >= 0) && (nGlyphId < mnCharStrCount));
         // get privdict context matching to the glyph
         const int nFDSelect = getFDSelect( nGlyphId);
+        if( nFDSelect < 0)
+            continue;
         mpCffLocal = &maCffLocal[ nFDSelect];
         // convert the Type2op charstring to its Type1op counterpart
         const int nT2Len = seekIndexData( mnCharStrBase, nGlyphId);


More information about the Libreoffice-commits mailing list