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

coverity#1242658 Untrusted loop bound

Change-Id: I6b4605e3223d11fe4f905e0d9141043a0d7527da
üst 9263fbe3
......@@ -988,6 +988,11 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo
if ( nRowBytes < 8 || nPackType == 1 )
{
const size_t nMaxPixels = pPict->remainingSize() / 4;
const size_t nMaxRows = nMaxPixels / nWidth;
if (nHeight > nMaxRows)
BITMAPERROR;
for ( ny = 0; ny < nHeight; ny++ )
{
for ( nx = 0; nx < nWidth; nx++ )
......
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