diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-10-24 10:49:06 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-10-25 09:57:17 +0200 |
commit | d5a37cd8af4e9025a773980aa1436f78ec1941f7 (patch) | |
tree | 42108f0b4bb699a56ac06d48ef9911c515eb9b06 /vcl/source | |
parent | 0b47baca102e8407c98799f409809796667e5ba5 (diff) |
ofz#3750 Undefined-shift
Change-Id: If227dea7758c22cadfad83192e0ad31a4183b5b5
Reviewed-on: https://gerrit.libreoffice.org/43747
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/dibtools.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
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) |