diff options
author | sj <sj@openoffice.org> | 2010-11-22 19:00:24 +0100 |
---|---|---|
committer | sj <sj@openoffice.org> | 2010-11-22 19:00:24 +0100 |
commit | fe4993ecf57e530d7adf63524ebfaac881eef3f9 (patch) | |
tree | 32dcc10d2ce97871b6c17397d97ce329a39a58c2 /filter | |
parent | 00a6a3f6279dcf3b790a17f21bccd3e4cea1fc57 (diff) |
os145: #b7001886# fixing small ppt import problem, improving png reader
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index f334c86bbc5f..e6a7c9821bde 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -1468,10 +1468,14 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S if ( bOk ) { - // PersistPtrs lesen (alle) - nPersistPtrAnz = aUserEditAtom.nMaxPersistWritten + 1; // 1 mehr, damit ich immer direkt indizieren kann - pPersistPtr = new UINT32[ nPersistPtrAnz ]; // (die fangen naemlich eigentlich bei 1 an) - if ( !pPersistPtr ) + nPersistPtrAnz = aUserEditAtom.nMaxPersistWritten + 1; + if ( ( nPersistPtrAnz >> 2 ) > nStreamLen ) // sj: at least nPersistPtrAnz is not allowed to be greater than filesize + bOk = FALSE; // (it should not be greater than the PPT_PST_PersistPtrIncrementalBlock, but + // we are reading this block later, so we do not have access yet) + + if ( bOk && ( nPersistPtrAnz < ( SAL_MAX_UINT32 / sizeof( UINT32 ) ) ) ) + pPersistPtr = new (std::nothrow) UINT32[ nPersistPtrAnz ]; + if ( bOk && !pPersistPtr ) bOk = FALSE; else { @@ -5087,8 +5091,8 @@ void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport& rIn >> nCharCount >> aParaPropSet.pParaSet->mnDepth; // Einruecktiefe - aParaPropSet.pParaSet->mnDepth = - std::min(sal_uInt16(9), + aParaPropSet.pParaSet->mnDepth = // taking care of about using not more than 9 outliner levels + std::min(sal_uInt16(8), aParaPropSet.pParaSet->mnDepth); nCharCount--; |