diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-07-20 08:35:26 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-07-20 09:11:16 +0000 |
commit | 1aac166075ef5a3183474449ae7d0fa3f7cf82b6 (patch) | |
tree | 143267595280669893108320adcfc706f099e936 /filter | |
parent | 19b9457ab69c05c96b2adce59e38ed8eb4bf62db (diff) |
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@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'filter')
-rw-r--r-- | filter/qa/cppunit/data/tiff/fail/crash-4.tiff | bin | 0 -> 260 bytes | |||
-rw-r--r-- | filter/source/graphicfilter/itiff/ccidecom.cxx | 9 |
2 files changed, 2 insertions, 7 deletions
diff --git a/filter/qa/cppunit/data/tiff/fail/crash-4.tiff b/filter/qa/cppunit/data/tiff/fail/crash-4.tiff Binary files differnew file mode 100644 index 000000000000..ef0fe2725f17 --- /dev/null +++ b/filter/qa/cppunit/data/tiff/fail/crash-4.tiff diff --git a/filter/source/graphicfilter/itiff/ccidecom.cxx b/filter/source/graphicfilter/itiff/ccidecom.cxx index f7eed8141085..24775428eb22 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# |