summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svtools/source/filter/filter.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/svtools/source/filter/filter.cxx b/svtools/source/filter/filter.cxx
index a4202039922b..ef07514285df 100644
--- a/svtools/source/filter/filter.cxx
+++ b/svtools/source/filter/filter.cxx
@@ -249,9 +249,14 @@ static sal_Bool ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtensio
nStreamLen = rStream.Tell() - nStreamPos;
rStream.Seek( nStreamPos );
}
- // Die ersten 256 Bytes in einen Buffer laden:
- if( nStreamLen >= 256 )
+ if (!nStreamLen)
+ {
+ return false; // this prevents at least a STL assertion
+ }
+ else if (nStreamLen >= 256)
+ { // load first 256 bytes into a buffer
rStream.Read( sFirstBytes, 256 );
+ }
else
{
rStream.Read( sFirstBytes, nStreamLen );