Kaydet (Commit) 3bc3656c authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Andras Timar

don't loop forever if pcx has short read

Change-Id: I638792417924bcb8e48995f4e789f84a2cbf4757
(cherry picked from commit c9ba7a2a)
Reviewed-on: https://gerrit.libreoffice.org/17157Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst a95100b3
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment