summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-03 15:43:04 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-11-03 20:47:58 +0100
commit49747ff2337fd1f4a3ee8e16d6328b8dacad99ec (patch)
tree110901102d4ae356b161434a4e4064a28a0a738a /vcl/source
parent0981f1d8c8a8918b5f28bf5605023b07e73b0d44 (diff)
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: I75082c85862b83ed2503900186ce9c70783e54db Reviewed-on: https://gerrit.libreoffice.org/62817 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/dibtools.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index accae76a3726..b6ffa8fd9908 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -917,8 +917,7 @@ bool ImplReadDIBBody(SvStream& rIStm, Bitmap& rBmp, AlphaMask* pBmpAlpha, sal_uL
// (partially) check the image dimensions to avoid potential large bitmap allocation if the input is damaged
sal_uInt64 nMaxWidth = pIStm->remainingSize();
nMaxWidth *= 256; //assume generous compression ratio
- if (aHeader.nHeight != 0)
- nMaxWidth /= aHeader.nHeight;
+ nMaxWidth /= aHeader.nHeight;
if (nMaxWidth < static_cast<sal_uInt64>(aHeader.nWidth))
return false;
break;
@@ -929,8 +928,7 @@ bool ImplReadDIBBody(SvStream& rIStm, Bitmap& rBmp, AlphaMask* pBmpAlpha, sal_uL
return false;
sal_uInt64 nMaxWidth = pIStm->remainingSize();
nMaxWidth *= 512; //assume generous compression ratio
- if (aHeader.nHeight != 0)
- nMaxWidth /= aHeader.nHeight;
+ nMaxWidth /= aHeader.nHeight;
if (nMaxWidth < static_cast<sal_uInt64>(aHeader.nWidth))
return false;
break;
@@ -942,8 +940,7 @@ bool ImplReadDIBBody(SvStream& rIStm, Bitmap& rBmp, AlphaMask* pBmpAlpha, sal_uL
{
// (partially) check the image dimensions to avoid potential large bitmap allocation if the input is damaged
sal_uInt64 nMaxWidth = pIStm->remainingSize();
- if (aHeader.nHeight != 0)
- nMaxWidth /= aHeader.nHeight;
+ nMaxWidth /= aHeader.nHeight;
if (nMaxWidth < nAlignedWidth)
return false;
break;