summaryrefslogtreecommitdiff
path: root/sd/source/filter/ppt/propread.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-09-18 13:11:46 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-09-18 13:11:52 +0100
commitf6368c29bdc3a9017bcae3f064d2cd8c7e37ed10 (patch)
treeb870df6fc1c9a3328a33505d69d6a2c9ac47bd64 /sd/source/filter/ppt/propread.cxx
parent8523e57e427ef5b0b7f7067dcdd07f01176d2160 (diff)
if nSize was 1 with unicode encoding
nSize would wrap around in lcl_getMaxSafeStrLen Change-Id: Ie99d4abc271a6fe72b256a6bfe0757609e9523f9
Diffstat (limited to 'sd/source/filter/ppt/propread.cxx')
-rw-r--r--sd/source/filter/ppt/propread.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index 9fd2501ff732..b76fbcaec5b4 100644
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -289,6 +289,8 @@ void Section::GetDictionary(Dictionary& rDict)
{
sal_uInt32 nId(0), nSize(0);
aStream.ReadUInt32( nId ).ReadUInt32( nSize );
+ if (mnTextEnc == RTL_TEXTENCODING_UCS2)
+ nSize >>= 1;
if (!nSize)
continue;
OUString aString;
@@ -296,7 +298,6 @@ void Section::GetDictionary(Dictionary& rDict)
{
if ( mnTextEnc == RTL_TEXTENCODING_UCS2 )
{
- nSize >>= 1;
sal_Unicode* pWString = new sal_Unicode[nSize];
for (sal_uInt32 j = 0; j < nSize; ++j)
aStream.ReadUInt16(pWString[j]);