[Libreoffice-commits] core.git: 2 commits - filter/qa filter/source tools/source
Caolán McNamara
caolanm at redhat.com
Fri Jul 17 03:22:40 PDT 2015
filter/qa/cppunit/data/pcx/fail/hang-1.pcx |binary
filter/qa/cppunit/data/tiff/fail/hang-4.tiff |binary
filter/source/graphicfilter/ipcx/ipcx.cxx | 4 ++--
tools/source/stream/stream.cxx | 2 +-
4 files changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 6a1f31898d4d44d69f4f65e56f5dd087607885af
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jul 17 10:26:46 2015 +0100
in remainingSize consider that its is possible to seek past the end
Change-Id: I1652244d5515629f1cd8f15f4c5b15f139dba0aa
diff --git a/filter/qa/cppunit/data/tiff/fail/hang-4.tiff b/filter/qa/cppunit/data/tiff/fail/hang-4.tiff
new file mode 100644
index 0000000..4048941
Binary files /dev/null and b/filter/qa/cppunit/data/tiff/fail/hang-4.tiff differ
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index c1d21da..7dd5dd4 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1453,7 +1453,7 @@ sal_uInt64 SvStream::remainingSize()
{
sal_uInt64 const nCurr = Tell();
sal_uInt64 const nEnd = Seek(STREAM_SEEK_TO_END);
- sal_uInt64 nMaxAvailable = nEnd-nCurr;
+ sal_uInt64 nMaxAvailable = nEnd > nCurr ? (nEnd-nCurr) : 0;
Seek(nCurr);
return nMaxAvailable;
}
commit c9ba7a2a4d29af2542f31562cfdd64db2237aea8
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
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 176299f..f89bc7c 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