diff options
Diffstat (limited to 'sot')
-rw-r--r-- | sot/source/sdstor/stg.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index 398e3fdb53d1..73a19719f86e 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -315,8 +315,17 @@ bool Storage::IsStorageFile( SvStream* pStream ) { StgHeader aHdr; sal_uInt64 nPos = pStream->Tell(); - bRet = ( aHdr.Load( *pStream ) && aHdr.Check() ); - + try + { + bRet = ( aHdr.Load( *pStream ) && aHdr.Check() ); + } + catch(SvStreamEOFException&) + { + // It's not a stream error if it is too small for an OLE storage header + pStream->ResetError(); + pStream->Seek( nPos ); + return false; + } // It's not a stream error if it is too small for an OLE storage header if ( pStream->GetErrorCode() == ERRCODE_IO_CANTSEEK ) pStream->ResetError(); |