summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-07-05 11:24:52 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-07-05 22:27:05 +0200
commit53db174c804a4a378db3a12582d45488020097a3 (patch)
treea80a2aea39ee71338799fd85979a12657c2de158 /vcl/source
parentf54c6938f73b94fb6f722f3ea68454fee424e62e (diff)
coverity#1414484 Division or modulo by zero
this looks wrong since initial checkin, why check that xres is non 0 before dividing by yres Change-Id: I5f1c19dadafe561cac8fde4f2bf371587c4ef5f0 Reviewed-on: https://gerrit.libreoffice.org/39573 Tested-by: Jenkins <ci@libreoffice.org> 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/filter/graphicfilter2.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx
index 377111166f25..51ef11b62455 100644
--- a/vcl/source/filter/graphicfilter2.cxx
+++ b/vcl/source/filter/graphicfilter2.cxx
@@ -587,12 +587,10 @@ bool GraphicDescriptor::ImpDetectPNG( SvStream& rStm, bool bExtendedInfo )
if ( cByte )
{
if ( nXRes )
- aLogSize.Width() = ( aPixSize.Width() * 100000 ) /
- nTemp32;
+ aLogSize.Width() = (aPixSize.Width() * 100000) / nXRes;
if ( nYRes )
- aLogSize.Height() = ( aPixSize.Height() * 100000 ) /
- nTemp32;
+ aLogSize.Height() = (aPixSize.Height() * 100000) / nYRes;
}
}
}