Kaydet (Commit) 7f0b3e90 authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz: timeout, check availablity of point data before reading it

Change-Id: I86b3041bc5123ba10bbb9b64702dfb2060b3cc23
üst 162cd5d4
......@@ -461,6 +461,12 @@ sal_uLong PictReader::ReadPolygon(tools::Polygon & rPoly)
pPict->SeekRel(8);
sal_uLong nDataSize = (sal_uLong)nSize;
nSize=(nSize-10)/4;
const size_t nMaxPossiblePoints = pPict->remainingSize() / 2 * sizeof(sal_uInt16);
if (nSize > nMaxPossiblePoints)
{
SAL_WARN("filter.pict", "pict record claims to have: " << nSize << " points, but only " << nMaxPossiblePoints << " possible, clamping");
nSize = nMaxPossiblePoints;
}
rPoly.SetSize(nSize);
for (sal_uInt16 i = 0; i < nSize; ++i)
rPoly.SetPoint(ReadPoint(), i);
......
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