[Libreoffice-commits] .: svtools/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 23 01:41:11 PDT 2012


 svtools/source/filter/igif/gifread.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 4aa33cae65dd90f60873922dfb0c3f9b106537f9
Author: Tor Lillqvist <tml at iki.fi>
Date:   Tue Oct 23 11:40:12 2012 +0300

    Make loading CVE-2008-5937-1.gif fail (as expected) also on 64-bit Mac OS X
    
    Change-Id: Ia300ebf0c1365699869f386c7257519bcedf2687

diff --git a/svtools/source/filter/igif/gifread.cxx b/svtools/source/filter/igif/gifread.cxx
index 5f91b61..8d41882 100644
--- a/svtools/source/filter/igif/gifread.cxx
+++ b/svtools/source/filter/igif/gifread.cxx
@@ -96,6 +96,20 @@ sal_Bool GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPa
 {
     const Size aSize( nWidth, nHeight );
 
+#ifdef __LP64__
+    // Don't bother allocating a bitmap of a size that would fail on a
+    // 32-bit system. We have at least one unit tests that is expected
+    // to fail (loading a 65535*65535 size GIF
+    // svtools/qa/cppunit/data/gif/fail/CVE-2008-5937-1.gif), but
+    // which doesn't fail on 64-bit Mac OS X at least. Why the loading
+    // fails on 64-bit Linux, no idea.
+    if (nWidth >= 64000 && nHeight >= 64000)
+    {
+        bStatus = sal_False;
+        return bStatus;
+    }
+#endif
+
     if( bGCTransparent )
     {
         const Color aWhite( COL_WHITE );


More information about the Libreoffice-commits mailing list