ofz#4079 check for error earlier

Change-Id: I141417811b0d64dbf1ad898f9f3a00e4e02d33c8
Reviewed-on: https://gerrit.libreoffice.org/44826
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2017-11-16 15:22:11 +01:00
parent 4902712243
commit 359286b90f
+5 -2
View File
@@ -136,7 +136,10 @@ bool StgHeader::Load( SvStream& r )
.ReadUInt16( m_nByteOrder ) // 1C Unicode byte order indicator
.ReadInt16( m_nPageSize ) // 1E 1 << nPageSize = block size
.ReadInt16( m_nDataPageSize ); // 20 1 << this size == data block size
r.SeekRel( 10 );
if (!r.good())
return false;
if (!checkSeek(r, r.Tell() + 10))
return false;
r.ReadInt32( m_nFATSize ) // 2C total number of FAT pages
.ReadInt32( m_nTOCstrm ) // 30 starting page for the TOC stream
.ReadInt32( m_nReserved ) // 34
@@ -148,7 +151,7 @@ bool StgHeader::Load( SvStream& r )
for(sal_Int32 & i : m_nMasterFAT)
r.ReadInt32( i );
return (r.GetErrorCode() == ERRCODE_NONE) && Check();
return r.good() && Check();
}
bool StgHeader::Store( StgIo& rIo )