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

Caolán McNamara caolanm at redhat.com
Tue Oct 24 11:54:16 UTC 2017


 filter/source/graphicfilter/itiff/itiff.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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

    ofz#3741 Integer-overflow
    
    Change-Id: I5059eca94cde52696affbf40753b9db1061a8c2b
    Reviewed-on: https://gerrit.libreoffice.org/43740
    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/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index 192f3deae086..7a57097b2ab3 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -1336,7 +1336,9 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
                     if ( nBitsPerSample == 32 )         // sj: i93300, compiler bug, 1 << 32 gives 1 one 32bit windows platforms,
                         nMaxSampleValue = 0xffffffff;   // (up from 80286 only the lower 5 bits are used when shifting a 32bit register)
                     else
-                        nMaxSampleValue = ( 1 << nBitsPerSample ) - 1;
+                    {
+                        nMaxSampleValue = (1U << nBitsPerSample) - 1;
+                    }
                 }
                 if ( nPhotometricInterpretation == 2 || nPhotometricInterpretation == 5 || nPhotometricInterpretation == 6 )
                     nDstBitsPerPixel = 24;


More information about the Libreoffice-commits mailing list