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

Caolán McNamara caolanm at redhat.com
Wed Jul 5 20:27:32 UTC 2017


 vcl/source/filter/graphicfilter2.cxx |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 53db174c804a4a378db3a12582d45488020097a3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jul 5 11:24:52 2017 +0100

    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 at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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;
                     }
                 }
             }


More information about the Libreoffice-commits mailing list