diff options
-rw-r--r-- | tools/source/zcodec/zcodec.cxx | 2 | ||||
-rw-r--r-- | vcl/qa/cppunit/graphicfilter/data/bmp/fail/nodict-compress.bmp | bin | 0 -> 110 bytes | |||
-rw-r--r-- | vcl/source/gdi/dibtools.cxx | 5 |
3 files changed, 4 insertions, 3 deletions
diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx index 161aa33e41ad..c935bb8c4562 100644 --- a/tools/source/zcodec/zcodec.cxx +++ b/tools/source/zcodec/zcodec.cxx @@ -222,7 +222,7 @@ long ZCodec::Read( SvStream& rIStm, sal_uInt8* pData, sal_uInt32 nSize ) } err = mbStatus ? inflate(PZSTREAM, Z_NO_FLUSH) : Z_ERRNO; - if ( err < 0 ) + if (err < 0 || err == Z_NEED_DICT) { // Accept Z_BUF_ERROR as EAGAIN or EWOULDBLOCK. mbStatus = (err == Z_BUF_ERROR); diff --git a/vcl/qa/cppunit/graphicfilter/data/bmp/fail/nodict-compress.bmp b/vcl/qa/cppunit/graphicfilter/data/bmp/fail/nodict-compress.bmp Binary files differnew file mode 100644 index 000000000000..a75d6ebae540 --- /dev/null +++ b/vcl/qa/cppunit/graphicfilter/data/bmp/fail/nodict-compress.bmp diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx index 89abf96edbb5..8dd710e5dab1 100644 --- a/vcl/source/gdi/dibtools.cxx +++ b/vcl/source/gdi/dibtools.cxx @@ -841,7 +841,8 @@ bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, AlphaMask* pBmpAlpha, sal_u // Seek behind the encoded block. There might have been bytes left or the codec might have read more than necessary. rIStm.Seek(nCodedSize + nCodedPos); } - else + + if (aData.empty()) { // add something so we can take address of the first element aData.resize(1); @@ -850,7 +851,7 @@ bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, AlphaMask* pBmpAlpha, sal_u // set decoded bytes to memory stream, // from which we will read the bitmap data - pMemStm.reset( new SvMemoryStream); + pMemStm.reset(new SvMemoryStream); pIStm = pMemStm.get(); assert(!aData.empty()); pMemStm->SetBuffer(aData.data(), nUncodedSize, nUncodedSize); |