Kaydet (Commit) 9f856628 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) David Tardon

fix crash on loading certain ppts

Change-Id: I544a67e3706c7d12414cc075118ef2f0f5ddd0f6
(cherry picked from commit 334dba62)
Reviewed-on: https://gerrit.libreoffice.org/18015Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst 49629e96
......@@ -4029,13 +4029,13 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
ReadDffRecordHeader( rIn, aTxMasterStyleHd );
if ( aTxMasterStyleHd.nRecType == PPT_PST_TxMasterStyleAtom )
{
sal_uInt16 nLevelAnz;
rIn.ReadUInt16( nLevelAnz );
sal_uInt16 nLevelAnz(0);
rIn.ReadUInt16(nLevelAnz);
sal_uInt16 nLev = 0;
bool bFirst = true;
bFoundTxMasterStyleAtom04 = true;
while ( rIn.GetError() == 0 && rIn.Tell() < aTxMasterStyleHd.GetRecEndFilePos() && nLev < nLevelAnz )
while (rIn.GetError() == 0 && rIn.Tell() < aTxMasterStyleHd.GetRecEndFilePos() && nLev < nLevelAnz && nLev < nMaxPPTLevels)
{
if ( nLev )
{
......
......@@ -168,6 +168,8 @@ const sal_uInt32 PPTInventor = sal_uInt32('P') * 0x00000001
+ sal_uInt32('T') * 0x00010000
+ sal_uInt32('0') * 0x01000000;
const int nMaxPPTLevels = 5;
// Object IDs for StarDraw UserData
#define PPT_OBJECTINFO_ID (1)
......@@ -712,7 +714,7 @@ struct PPTExtParaLevel
struct PPTExtParaSheet
{
PPTExtParaLevel aExtParaLevel[ 5 ];
PPTExtParaLevel aExtParaLevel[nMaxPPTLevels];
};
struct PPTBuGraEntry
......@@ -759,7 +761,7 @@ struct PPTCharLevel
struct PPTCharSheet
{
PPTCharLevel maCharLevel[ 5 ];
PPTCharLevel maCharLevel[nMaxPPTLevels];
explicit PPTCharSheet( sal_uInt32 nInstance );
PPTCharSheet( const PPTCharSheet& rCharSheet );
......@@ -792,7 +794,7 @@ struct PPTParaSheet
{
public:
PPTParaLevel maParaLevel[ 5 ];
PPTParaLevel maParaLevel[nMaxPPTLevels];
explicit PPTParaSheet( sal_uInt32 nInstance );
PPTParaSheet( const PPTParaSheet& rParaSheet );
......@@ -997,8 +999,8 @@ struct PPTRuler
sal_Int32 nFlags;
sal_uInt16 nDefaultTab;
sal_uInt16 nTextOfs[ 5 ];
sal_uInt16 nBulletOfs[ 5 ];
sal_uInt16 nTextOfs[nMaxPPTLevels];
sal_uInt16 nBulletOfs[nMaxPPTLevels];
PPTTabEntry* pTab;
sal_uInt16 nTabCount;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment