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

Caolán McNamara caolanm at redhat.com
Mon Jul 20 02:11:42 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 1aac166075ef5a3183474449ae7d0fa3f7cf82b6
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/17204
    Tested-by: Jenkins <ci at libreoffice.org>
    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 f7eed81..2477542 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