[Libreoffice-commits] core.git: sot/source

Caolán McNamara caolanm at redhat.com
Thu Nov 16 14:22:32 UTC 2017


 sot/source/sdstor/stgelem.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 359286b90f4d9962a3c1cb936ac7fd4140f71baa
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 16 13:14:36 2017 +0000

    ofz#4079 check for error earlier
    
    Change-Id: I141417811b0d64dbf1ad898f9f3a00e4e02d33c8
    Reviewed-on: https://gerrit.libreoffice.org/44826
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sot/source/sdstor/stgelem.cxx b/sot/source/sdstor/stgelem.cxx
index 7016a3a8f5f0..c474d5b3e100 100644
--- a/sot/source/sdstor/stgelem.cxx
+++ b/sot/source/sdstor/stgelem.cxx
@@ -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 )


More information about the Libreoffice-commits mailing list