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

Caolán McNamara caolanm at redhat.com
Tue Oct 3 15:04:08 UTC 2017


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

New commits:
commit 7dbb98bf18a8431f6063c4e9bf7b3fa21867e78c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 3 14:10:31 2017 +0100

    ofz#3540: oom move compression size test earlier
    
    Change-Id: I1ca4f08ef526498cf08665f2b23d56095d5f1323
    Reviewed-on: https://gerrit.libreoffice.org/43082
    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 e9f07689387c..0e27706c8fde 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -1433,6 +1433,13 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
                         if (nStart > nEndOfFile)
                             bStatus = false;
                     }
+
+                    if (bStatus)
+                    {
+                        sal_uLong nTargetBits = nImageWidth * nBitsPerSample * nSamplesPerPixel / nPlanes;
+                        if (nTargetBits > SAL_MAX_UINT16)
+                            bStatus = false;
+                    }
                 }
                 else if ( nCompression == 5 )
                 {


More information about the Libreoffice-commits mailing list