[Libreoffice-commits] core.git: filter/qa filter/source

Caolán McNamara caolanm at redhat.com
Mon Jul 20 03:25:13 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 6964f67d0dd44c8a3c68caf194075ba5c649bf4b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jul 20 11:20:45 2015 +0100

    don't hang on a bad ReadCodeAndDecode
    
    Change-Id: I999012d428fa84e21fe9e9f851a016eacc96a686

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 4a49f73..025240c 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) 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