[Libreoffice-commits] .: sw/source

Caolán McNamara caolan at kemper.freedesktop.org
Tue Jul 5 02:54:02 PDT 2011


 sw/source/filter/ww8/ww8scan.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit ce914b764cad6a47d57bc5332d5ad2bbffb9f679
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jul 5 10:53:35 2011 +0100

    check font offset position

diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index ba38e49..36e7148 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -6187,12 +6187,11 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
     if( rFib.lcbSttbfffn <= 2 )
     {
         OSL_ENSURE( !this, "Fonttabelle kaputt! (rFib.lcbSttbfffn < 2)" );
-        pFontA = 0;
-        nMax = 0;
         return;
     }
 
-    rSt.Seek( rFib.fcSttbfffn );
+    if (!checkSeek(rSt, rFib.fcSttbfffn))
+        return;
 
     sal_Int32 nFFn = rFib.lcbSttbfffn - 2;
 
@@ -6244,8 +6243,8 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
         pFontA = new WW8_FFN[ nMax ];
         p = pFontA;
 
-    if( eVersion <= ww::eWW2 )
-    {
+        if( eVersion <= ww::eWW2 )
+        {
             WW8_FFN_BASE* pVer2 = (WW8_FFN_BASE*)pA;
             for(sal_uInt16 i=0; i<nMax; ++i, ++p)
             {
@@ -6269,7 +6268,7 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
                 p->sFontname = String ( (((const sal_Char*)pVer2) + 1 + 2), eEnc);
                 pVer2 = (WW8_FFN_BASE*)( ((sal_uInt8*)pVer2) + pVer2->cbFfnM1 + 1 );
             }
-    }
+        }
         else if( eVersion < ww::eWW8 )
         {
             WW8_FFN_Ver6* pVer6 = (WW8_FFN_Ver6*)pA;


More information about the Libreoffice-commits mailing list