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

Caolán McNamara caolanm at redhat.com
Wed Feb 22 20:50:35 UTC 2017


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

New commits:
commit c5b1a01ddfa54156b4fa8e542d6936908257ca93
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Feb 22 20:39:13 2017 +0000

    ofz: don't read data that isn't there
    
    Change-Id: I9f730c321755cde169d940b49fc93bbe057ead57

diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index d5067eb..6101d20 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -923,12 +923,16 @@ bool TIFFReader::ConvertScanline(sal_Int32 nY)
         {
             sal_uLong nMinMax = ( ( 1 << nDstBitsPerPixel ) - 1 ) / ( nMaxSampleValue - nMinSampleValue );
             sal_uInt8* pt = pMap[ 0 ];
+            sal_uInt8* ptend = pt + nBytesPerRow;
             sal_uInt8 nShift;
 
             switch ( nDstBitsPerPixel )
             {
                 case 8 :
                 {
+                    if (pt + nImageWidth > ptend)
+                        return false;
+
                     if ( bByteSwap )
                     {
                         if ( nPredictor == 2 )


More information about the Libreoffice-commits mailing list