[Libreoffice-commits] core.git: vcl/source

Caolán McNamara caolanm at redhat.com
Wed Oct 25 07:57:38 UTC 2017


 vcl/source/gdi/dibtools.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit d5a37cd8af4e9025a773980aa1436f78ec1941f7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 24 10:49:06 2017 +0100

    ofz#3750 Undefined-shift
    
    Change-Id: If227dea7758c22cadfad83192e0ad31a4183b5b5
    Reviewed-on: https://gerrit.libreoffice.org/43747
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index 4a53e90950bc..02ab6d068bc8 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -773,13 +773,16 @@ bool ImplReadDIBBody(SvStream& rIStm, Bitmap& rBmp, AlphaMask* pBmpAlpha, sal_uL
     const sal_uLong nStmPos = rIStm.Tell();
     bool bTopDown(false);
 
-    if (!ImplReadDIBInfoHeader(rIStm, aHeader, bTopDown, bMSOFormat) && aHeader.nWidth && aHeader.nHeight && aHeader.nBitCount)
+    if (!ImplReadDIBInfoHeader(rIStm, aHeader, bTopDown, bMSOFormat))
         return false;
 
     //BI_BITCOUNT_0 jpeg/png is unsupported
     if (aHeader.nBitCount == 0)
         return false;
 
+    if (aHeader.nWidth <= 0 || aHeader.nHeight <= 0)
+        return false;
+
     // In case ImplReadDIB() didn't call ImplReadDIBFileHeader() before
     // this method, nOffset is 0, that's OK.
     if (nOffset && aHeader.nSize > nOffset)


More information about the Libreoffice-commits mailing list