ofz#827 avoid oom in xpms
Change-Id: I323be5e042e0ccb21956def70a8c481833f43998
diff --git a/vcl/source/filter/ixpm/xpmread.cxx b/vcl/source/filter/ixpm/xpmread.cxx
index 6d348eb..19b3fd4 100644
--- a/vcl/source/filter/ixpm/xpmread.cxx
+++ b/vcl/source/filter/ixpm/xpmread.cxx
@@ -160,6 +160,10 @@ ReadState XPMReader::ReadXPM( Graphic& rGraphic )
mbStatus = false;
if ( ( mnWidth * mnCpp ) >= XPMSTRINGBUF )
mbStatus = false;
//xpms are a minimum of one character (one byte) per pixel, so if the file isn't
//even that long, its not all there
if (mrIStm.remainingSize() < static_cast<sal_uInt64>(mnWidth) * mnHeight)
mbStatus = false;
if ( mbStatus && mnWidth && mnHeight && mnColors && mnCpp )
{
mnIdentifier = XPMCOLORS;