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

coverity#1242704 Untrusted loop bound

Change-Id: Id8a80028ad00ec7ae79eaa9d877a1fef9f4d082c
üst 7be2fba4
......@@ -643,7 +643,12 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
Point aPoint( ReadYX() );
pWMF->ReadUInt16( nDontKnow ).ReadUInt16( nWidth ).ReadUInt16( nHeight ).ReadUInt16( nBytesPerScan ).ReadUChar( nPlanes ).ReadUChar( nBitCount );
if ( nWidth && nHeight && ( nPlanes == 1 ) && ( nBitCount == 1 ) )
bool bOk = nWidth && nHeight && nPlanes == 1 && nBitCount == 1;
if (bOk)
{
bOk = nBytesPerScan <= pWMF->remainingSize() / nHeight;
}
if (bOk)
{
Bitmap aBmp( Size( nWidth, nHeight ), nBitCount );
BitmapWriteAccess* pAcc;
......
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