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

Caolán McNamara caolanm at redhat.com
Fri Jul 17 05:22:02 PDT 2015


 filter/qa/cppunit/data/pcx/fail/hang-1.pcx |binary
 filter/source/graphicfilter/ipcx/ipcx.cxx  |    4 ++--
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit f45821e73e4db672c013d9c71816c1d36c421873
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jul 17 10:11:34 2015 +0100

    don't loop forever if pcx has short read
    
    Change-Id: I638792417924bcb8e48995f4e789f84a2cbf4757
    (cherry picked from commit c9ba7a2a4d29af2542f31562cfdd64db2237aea8)
    Reviewed-on: https://gerrit.libreoffice.org/17159
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/filter/qa/cppunit/data/pcx/fail/hang-1.pcx b/filter/qa/cppunit/data/pcx/fail/hang-1.pcx
new file mode 100644
index 0000000..73798ea
Binary files /dev/null and b/filter/qa/cppunit/data/pcx/fail/hang-1.pcx differ
diff --git a/filter/source/graphicfilter/ipcx/ipcx.cxx b/filter/source/graphicfilter/ipcx/ipcx.cxx
index 09604932..f5326fe 100644
--- a/filter/source/graphicfilter/ipcx/ipcx.cxx
+++ b/filter/source/graphicfilter/ipcx/ipcx.cxx
@@ -230,7 +230,7 @@ void PCXReader::ImplReadBody(BitmapWriteAccess * pAcc)
     nCount = 0;
     for ( ny = 0; ny < nHeight; ny++ )
     {
-        if (m_rPCX.GetError() || m_rPCX.IsEof())
+        if (!m_rPCX.good())
         {
             nStatus = false;
             break;
@@ -256,7 +256,7 @@ void PCXReader::ImplReadBody(BitmapWriteAccess * pAcc)
                     nx--;
                     nCount--;
                 }
-                while ( nx > 0 )
+                while (nx > 0 && m_rPCX.good())
                 {
                     m_rPCX.ReadUChar( nDat );
                     if ( ( nDat & 0xc0 ) == 0xc0 )


More information about the Libreoffice-commits mailing list