[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - filter/qa filter/source

Caolán McNamara caolanm at redhat.com
Mon Jul 20 02:12:25 PDT 2015


 filter/qa/cppunit/data/tiff/fail/crash-4.tiff  |binary
 filter/source/graphicfilter/itiff/ccidecom.cxx |    9 ++-------
 2 files changed, 2 insertions(+), 7 deletions(-)

New commits:
commit f379b1ace95e25798d16c4980fb6a136fcf79715
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jul 20 08:35:26 2015 +0100

    reduce scope, etc, don't loop endlessly
    
    Change-Id: I86e4e94392527b5faf5d9cdb4251853f35813f4e
    (cherry picked from commit 5d32a4ac5c166264c2d44e8df625eb768eb42fbe)
    Reviewed-on: https://gerrit.libreoffice.org/17205
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/filter/qa/cppunit/data/tiff/fail/crash-4.tiff b/filter/qa/cppunit/data/tiff/fail/crash-4.tiff
new file mode 100644
index 0000000..ef0fe27
Binary files /dev/null and b/filter/qa/cppunit/data/tiff/fail/crash-4.tiff differ
diff --git a/filter/source/graphicfilter/itiff/ccidecom.cxx b/filter/source/graphicfilter/itiff/ccidecom.cxx
index 6cd2c41..de0299f 100644
--- a/filter/source/graphicfilter/itiff/ccidecom.cxx
+++ b/filter/source/graphicfilter/itiff/ccidecom.cxx
@@ -628,8 +628,6 @@ void CCIDecompressor::StartDecompression( SvStream & rIStream )
 
 bool CCIDecompressor::DecompressScanline( sal_uInt8 * pTarget, sal_uLong nTargetBits, bool bLastLine )
 {
-    sal_uInt16 i;
-    sal_uInt8 * pDst;
     bool b2D;
 
     if ( nEOLCount >= 5 )   // RTC (Return To Controller)
@@ -678,8 +676,7 @@ bool CCIDecompressor::DecompressScanline( sal_uInt8 * pTarget, sal_uLong nTarget
                 delete[] pLastLine;
             nLastLineSize = ( nTargetBits + 7 ) >> 3;
             pLastLine = new sal_uInt8[ nLastLineSize ];
-            pDst = pLastLine;
-            for ( i = 0; i < nLastLineSize; i++ ) *( pDst++ ) = 0x00;
+            memset(pLastLine, 0, nLastLineSize);
         }
     }
     // conditionally align start of line to next byte:
@@ -706,9 +703,7 @@ bool CCIDecompressor::DecompressScanline( sal_uInt8 * pTarget, sal_uLong nTarget
     // if we're in 2D mode we have to remember the line:
     if ( nOptions & CCI_OPTION_2D && bStatus )
     {
-        sal_uInt8 *pSrc = pTarget;
-        pDst = pLastLine;
-        for ( i = 0; i < nLastLineSize; i++ ) *(pDst++)=*(pSrc++);
+        memcpy(pLastLine, pTarget, nLastLineSize);
     }
 
     // #i122984#


More information about the Libreoffice-commits mailing list