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

Caolán McNamara caolanm at redhat.com
Mon Jul 20 03:44:23 PDT 2015


 filter/qa/cppunit/data/tiff/fail/hang-7.tiff   |binary
 filter/source/graphicfilter/itiff/ccidecom.cxx |    5 ++++-
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 0b5061e1af6f2e51065f0d60cbadf860ca08f899
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jul 20 11:20:45 2015 +0100

    don't hang on a bad ReadCodeAndDecode
    
    (cherry picked from commit 6964f67d0dd44c8a3c68caf194075ba5c649bf4b)
    
    Change-Id: I999012d428fa84e21fe9e9f851a016eacc96a686
    Reviewed-on: https://gerrit.libreoffice.org/17218
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/filter/qa/cppunit/data/tiff/fail/hang-7.tiff b/filter/qa/cppunit/data/tiff/fail/hang-7.tiff
new file mode 100644
index 0000000..61a5f2d
Binary files /dev/null and b/filter/qa/cppunit/data/tiff/fail/hang-7.tiff differ
diff --git a/filter/source/graphicfilter/itiff/ccidecom.cxx b/filter/source/graphicfilter/itiff/ccidecom.cxx
index 4752aa0..9b01a22 100644
--- a/filter/source/graphicfilter/itiff/ccidecom.cxx
+++ b/filter/source/graphicfilter/itiff/ccidecom.cxx
@@ -1026,11 +1026,14 @@ void CCIDecompressor::Read2DScanlineData(sal_uInt8 * pTarget, sal_uInt16 nTarget
     while (nBitPos<nTargetBits && bStatus) {
 
         n2DMode=ReadCodeAndDecode(p2DModeLookUp,10);
-        if (bStatus==false) return;
+        if (!bStatus)
+            return;
 
         if (n2DMode==CCI2DMODE_UNCOMP) {
             for (;;) {
                 nUncomp=ReadCodeAndDecode(pUncompLookUp,11);
+                if (!bStatus)
+                    break;
                 if ( nUncomp <= CCIUNCOMP_4White_1Black ) {
                     nRun=nUncomp-CCIUNCOMP_0White_1Black;
                     FillBits(pTarget,nTargetBits,nBitPos,nRun,0x00);


More information about the Libreoffice-commits mailing list