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

Caolán McNamara caolanm at redhat.com
Tue Mar 14 23:04:31 UTC 2017


 vcl/source/filter/ixbm/xbmread.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit d4873496e8c74192f50f061cd8ab512e706a44ad
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 14 21:23:12 2017 +0000

    return early on clearly broken xbms
    
    Change-Id: Ic94a75aacb6bcd47d594a12e0df999a58b04b061

diff --git a/vcl/source/filter/ixbm/xbmread.cxx b/vcl/source/filter/ixbm/xbmread.cxx
index 38475fd..d3d21c4 100644
--- a/vcl/source/filter/ixbm/xbmread.cxx
+++ b/vcl/source/filter/ixbm/xbmread.cxx
@@ -308,6 +308,11 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic )
                         else
                             bStatus = false;
 
+                        //xbms are a minimum of one character per 8 pixels, so if the file isn't
+                        //even that long, its not all there
+                        if (rIStm.remainingSize() < (static_cast<sal_uInt64>(nWidth) * nHeight) / 8)
+                            bStatus = false;
+
                         if ( bStatus && nWidth && nHeight )
                         {
                             aBmp1 = Bitmap( Size( nWidth, nHeight ), 1 );


More information about the Libreoffice-commits mailing list