summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/ww8graf.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter/ww8/ww8graf.cxx')
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 7d843a225a0a..e3fbbaf62732 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1248,12 +1248,20 @@ SdrObject* SwWW8ImplReader::ReadCaptionBox(WW8_DPHEAD* pHd, SfxAllItemSet &rSet)
return nullptr;
sal_uInt16 nCount = SVBT16ToShort( aCallB.dpPolyLine.aBits1 ) >> 1 & 0x7fff;
+ if (nCount < 1)
+ {
+ SAL_WARN("sw.ww8", "Short CaptionBox header");
+ return nullptr;
+ }
+
std::unique_ptr<SVBT16[]> xP(new SVBT16[nCount * 2]);
bool bCouldRead = checkRead(*m_pStrm, xP.get(), nCount * 4); // Punkte einlesen
- OSL_ENSURE(bCouldRead, "Short CaptionBox header");
if (!bCouldRead)
+ {
+ SAL_WARN("sw.ww8", "Short CaptionBox header");
return nullptr;
+ }
sal_uInt8 nTyp = (sal_uInt8)nCount - 1;
if( nTyp == 1 && SVBT16ToShort( xP[0] ) == SVBT16ToShort( xP[2] ) )