summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-14 21:23:12 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-03-14 23:03:32 +0000
commitd4873496e8c74192f50f061cd8ab512e706a44ad (patch)
tree746356093b5ed995a3466ccdf574e6f9153f57ee /vcl
parente597ef0489d9d5504721d21eefa15c65da0fb240 (diff)
return early on clearly broken xbms
Change-Id: Ic94a75aacb6bcd47d594a12e0df999a58b04b061
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/ixbm/xbmread.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/source/filter/ixbm/xbmread.cxx b/vcl/source/filter/ixbm/xbmread.cxx
index 38475fdb0273..d3d21c4229c7 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 );