cid#1458434 Untrusted loop bound

Change-Id: I3fd06ddf1548c1d6b5d8e91db944d2c720040718
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89873
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara 2020-03-03 10:30:51 +00:00
parent b3c18cdc07
commit 43518b29fd

View file

@ -1078,6 +1078,9 @@ sal_uInt64 PictReader::ReadPixMapEtc( BitmapEx &rBitmap, bool bBaseAddr, bool bC
pBitmap.reset(new vcl::bitmap::RawBitmap( Size(nWidth, nHeight), 24 ));
// cid#1458434 to sanitize Untrusted loop bound
nWidth = pBitmap->Width();
size_t nByteWidth = static_cast<size_t>(nWidth) * nCmpCount;
std::vector<sal_uInt8> aScanline(nByteWidth);
for (sal_uInt16 ny = 0; ny < nHeight; ++ny)