summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2011-11-30 16:06:18 +0100
committerMichael Stahl <mstahl@redhat.com>2011-12-03 00:48:11 +0100
commitfa5dffd7149661850bb27ea0b2d24de06d38a6bc (patch)
treeec36453a4f4394f46eeaca1a1b14d1de70aef6d3 /svtools
parenta28635374613e556a0093c242823ea90a3704f74 (diff)
svtools: ImpPeekGraphicFormat: STL assertion
Diffstat (limited to 'svtools')
-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 );