summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2014-07-14 23:55:04 +0300
committerAndras Timar <andras.timar@collabora.com>2014-07-22 11:43:40 +0200
commit477b5bda14c781ec6b2afb3590e4f66c85e1c62a (patch)
tree93de80433b1de293bb437af8c9191dd25914ec1c /starmath
parent0c45ed0a36432f5eff877e011fa4a3fa53518dca (diff)
fdo#81284 Don't write to zero length files
Change-Id: I4eddcda3977f43b39abdaa8d9089ff661092361c Reviewed-on: https://gerrit.libreoffice.org/10310 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/smdetect.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx
index ca9453ad09c7..c943bee91e23 100644
--- a/starmath/source/smdetect.cxx
+++ b/starmath/source/smdetect.cxx
@@ -296,8 +296,16 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor
//this approach, to be fixed at a better level than here
SvStream *pStrm = aMedium.GetInStream();
aTypeName = OUString();
+
+ sal_Size nStreamSize = 0;
if (pStrm && !pStrm->GetError())
{
+ pStrm->Seek( STREAM_SEEK_TO_BEGIN );
+ nStreamSize = pStrm->remainingSize();
+ }
+
+ if ( nStreamSize > 0 )
+ {
SotStorageRef aStorage = new SotStorage ( pStrm, sal_False );
if ( !aStorage->GetError() )
{