[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/qa vcl/source
Miklos Vajna
vmiklos at collabora.co.uk
Fri Apr 4 12:28:13 PDT 2014
vcl/qa/cppunit/graphicfilter/data/wmf/pass/noheader.wmf |binary
vcl/source/gdi/dibtools.cxx | 4 +++-
2 files changed, 3 insertions(+), 1 deletion(-)
New commits:
commit eeb86ba2a97e85b32ab790494a25f465140a55db
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Apr 4 17:29:02 2014 +0200
WMF import: restore support for the ImplReadDIB(bFileHeader=false) version
Regression from commit f7799c9317cc3187ae8aaedc36f829d478a59e77
(Resolves: #i124467# add check for image data offset..., 2014-03-28).
Change-Id: I71e78aefca2ca5b07f763ec798226b9bb39a5254
(cherry picked from commit 9984807f17593b97778fc31824c50706ea2e826c)
Reviewed-on: https://gerrit.libreoffice.org/8849
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/qa/cppunit/graphicfilter/data/wmf/pass/noheader.wmf b/vcl/qa/cppunit/graphicfilter/data/wmf/pass/noheader.wmf
new file mode 100644
index 0000000..bfd7e20
Binary files /dev/null and b/vcl/qa/cppunit/graphicfilter/data/wmf/pass/noheader.wmf differ
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index 2759c20..077f0b0 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -626,7 +626,9 @@ bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, Bitmap* pBmpAlpha, sal_uLon
if(ImplReadDIBInfoHeader(rIStm, aHeader, bTopDown) && aHeader.nWidth && aHeader.nHeight && aHeader.nBitCount)
{
- if (aHeader.nSize > nOffset)
+ // In case ImplReadDIB() didn't call ImplReadDIBFileHeader() before
+ // this method, nOffset is 0, that's OK.
+ if (nOffset && aHeader.nSize > nOffset)
{
// Header size claims to extend into the image data.
// Looks like an error.
More information about the Libreoffice-commits
mailing list