summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwpdrawobj.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx b/lotuswordpro/source/filter/lwpdrawobj.cxx
index f357f9d359ae..4ae627918441 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -591,7 +591,10 @@ void LwpDrawPolygon::Read()
this->ReadClosedObjStyle();
m_pStream->ReadUInt16( m_nNumPoints );
- m_pVector = new SdwPoint [m_nNumPoints];
+ if (m_nNumPoints > m_pStream->remainingSize() / 4)
+ throw BadRead();
+
+ m_pVector = new SdwPoint[m_nNumPoints];
for (sal_uInt16 nC = 0; nC < m_nNumPoints; nC++)
{