Kaydet (Commit) 8547c336 authored tarafından Caolán McNamara's avatar Caolán McNamara

WaE: C2220

Change-Id: Ibf9fa7ffc3beb237a470952c265fb1bce313a08a
üst 1a3eedcc
...@@ -1192,13 +1192,15 @@ void OS2METReader::ReadPolygons() ...@@ -1192,13 +1192,15 @@ void OS2METReader::ReadPolygons()
{ {
sal_uInt32 nNumPoints(0); sal_uInt32 nNumPoints(0);
pOS2MET->ReadUInt32(nNumPoints); pOS2MET->ReadUInt32(nNumPoints);
if (nNumPoints > (i == 0) ? SAL_MAX_UINT16-1 : SAL_MAX_UINT16) sal_uInt32 nLimit = SAL_MAX_UINT16;
if (i==0) --nLimit;
if (nNumPoints > nLimit)
{ {
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR); pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
ErrorCode=11; ErrorCode=11;
return; return;
} }
if (i==0) nNumPoints++; if (i==0) ++nNumPoints;
aPoly.SetSize((short)nNumPoints); aPoly.SetSize((short)nNumPoints);
for (sal_uInt32 j=0; j<nNumPoints; ++j) for (sal_uInt32 j=0; j<nNumPoints; ++j)
{ {
......
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