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

Caolán McNamara caolanm at redhat.com
Fri Jul 17 04:40:13 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 26cd5af62fdeb650714f36c948784de1016591e4
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/17157
    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 61b7fa6..8a5ddb3 100644
--- a/filter/source/graphicfilter/ipcx/ipcx.cxx
+++ b/filter/source/graphicfilter/ipcx/ipcx.cxx
@@ -224,7 +224,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;
@@ -248,7 +248,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