diff options
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/metaact.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 79d875542509..f398888a33b6 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -1441,7 +1441,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) rIStm >> mnLen; rIStm >> nAryLen; - if ( mnIndex > mnLen ) + if ( mnIndex + mnLen > maStr.Len() ) { mnIndex = 0; mpDXAry = 0; @@ -1481,6 +1481,12 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData ) sal_Unicode* pBuffer = maStr.AllocBuffer( nLen ); while ( nLen-- ) rIStm >> *pBuffer++; + + if ( mnIndex + mnLen > maStr.Len() ) + { + mnIndex = 0; + delete[] mpDXAry, mpDXAry = NULL; + } } } |