Author: orw
Date: Thu Aug 22 12:51:28 2013
New Revision: 1516436

URL: http://svn.apache.org/r1516436
Log:
122935: storage handling: adjust header field checking
        to import Microsoft Office documents in binary format created by Pages

        cherry-picked from trunk


Modified:
    openoffice/branches/AOO401/   (props changed)
    openoffice/branches/AOO401/main/sot/source/sdstor/stgelem.cxx

Propchange: openoffice/branches/AOO401/
------------------------------------------------------------------------------
  Merged /openoffice/trunk:r1516435

Modified: openoffice/branches/AOO401/main/sot/source/sdstor/stgelem.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/AOO401/main/sot/source/sdstor/stgelem.cxx?rev=1516436&r1=1516435&r2=1516436&view=diff
==============================================================================
--- openoffice/branches/AOO401/main/sot/source/sdstor/stgelem.cxx (original)
+++ openoffice/branches/AOO401/main/sot/source/sdstor/stgelem.cxx Thu Aug 22 
12:51:28 2013
@@ -198,7 +198,7 @@ sal_Bool StgHeader::Check()
             && nTOCstrm >= 0
             && nThreshold > 0
             && ( nDataFAT == STG_EOF || ( nDataFAT >= 0 && nDataFATSize > 0 ) )
-            && ( nMasterChain == STG_EOF || ( nMasterChain >=0 && nMaster > 0 
) )
+            && ( nMasterChain == STG_FREE || nMasterChain == STG_EOF || ( 
nMasterChain >=0 && nMaster > 0 ) )
             && nMaster >= 0;
 }
 
@@ -438,7 +438,7 @@ sal_Bool StgEntry::Load( const void* pFr
                n = ( n >> 1 ) - 1;
        if ( n > 31 || 
          (nSize < 0 && cType != STG_STORAGE) || 
-         ( nPage1 < 0 && nPage1 != STG_EOF ) )
+         ( nPage1 < 0 && nPage1 != STG_FREE && nPage1 != STG_EOF ) )
     {
         // the size makes no sence for the substorage
         // TODO/LATER: actually the size should be an unsigned value, but in 
this case it would mean a stream of more than 2Gb


Reply via email to