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

ofz#6330 Out-of-memory

Change-Id: Ie138705e7994915d7824d8cf1ae1a0e17e247256
Reviewed-on: https://gerrit.libreoffice.org/49740Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst c11c1afe
......@@ -40,7 +40,7 @@ private:
sal_uLong nPlanes; // no of planes
sal_uLong nBytesPerPlaneLin; // bytes per plane line
sal_uLong nWidth, nHeight; // dimension in pixel
sal_uInt32 nWidth, nHeight; // dimension in pixel
sal_uInt16 nResX, nResY; // resolution in pixel per inch or 0,0
sal_uInt16 nDestBitsPerPixel; // bits per pixel in destination bitmap 1,4,8 or 24
std::unique_ptr<sal_uInt8[]>
......@@ -96,6 +96,12 @@ bool PCXReader::ReadPCX(Graphic & rGraphic)
bStatus = false;
}
if (bStatus)
{
sal_uInt32 nResult;
bStatus = !o3tl::checked_multiply(nWidth, nHeight, nResult) && nResult <= SAL_MAX_INT32/2/3;
}
// Write BMP header and conditionally (maybe invalid for now) color palette:
if (bStatus)
{
......
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