Kaydet (Commit) 89857aac authored tarafından Caolán McNamara's avatar Caolán McNamara

tools polygons limited to 16bit indexes

Change-Id: Ib0f727a3681492c15b807ca159d8bf7675ee8f29
üst e1d78e12
...@@ -1172,18 +1172,35 @@ void OS2METReader::ReadPartialArc(bool bGivenPos, sal_uInt16 nOrderSize) ...@@ -1172,18 +1172,35 @@ void OS2METReader::ReadPartialArc(bool bGivenPos, sal_uInt16 nOrderSize)
void OS2METReader::ReadPolygons() void OS2METReader::ReadPolygons()
{ {
sal_uInt32 i,j,nNumPolys, nNumPoints;
tools::PolyPolygon aPolyPoly; tools::PolyPolygon aPolyPoly;
Polygon aPoly; Polygon aPoly;
Point aPoint; Point aPoint;
sal_uInt8 nFlags;
pOS2MET->ReadUChar( nFlags ).ReadUInt32( nNumPolys ); sal_uInt8 nFlags(0);
for (i=0; i<nNumPolys; i++) { sal_uInt32 nNumPolys(0);
pOS2MET->ReadUInt32( nNumPoints ); pOS2MET->ReadUChar(nFlags).ReadUInt32(nNumPolys);
if (nNumPolys > SAL_MAX_UINT16)
{
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
ErrorCode=11;
return;
}
for (sal_uInt32 i=0; i<nNumPolys; ++i)
{
sal_uInt32 nNumPoints(0);
pOS2MET->ReadUInt32(nNumPoints);
if (nNumPoints > (i == 0) ? SAL_MAX_UINT16-1 : SAL_MAX_UINT16)
{
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
ErrorCode=11;
return;
}
if (i==0) nNumPoints++; if (i==0) nNumPoints++;
aPoly.SetSize((short)nNumPoints); aPoly.SetSize((short)nNumPoints);
for (j=0; j<nNumPoints; j++) { for (sal_uInt32 j=0; j<nNumPoints; ++j)
{
if (i==0 && j==0) aPoint=aAttr.aCurPos; if (i==0 && j==0) aPoint=aAttr.aCurPos;
else aPoint=ReadPoint(); else aPoint=ReadPoint();
aPoly.SetPoint(aPoint,(short)j); aPoly.SetPoint(aPoint,(short)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