summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-03-07 19:24:42 +0000
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-04-09 23:22:08 +0200
commit82a44e133707e21aa60b3f13e5c62d3127c25106 (patch)
treea3009b654983cc804b21ea1444238ff3a0173a64
parentofz#20517 null-dereference (diff)
downloadcore-82a44e133707e21aa60b3f13e5c62d3127c25106.tar.gz
core-82a44e133707e21aa60b3f13e5c62d3127c25106.zip
ofz#20622 oom
Change-Id: Id77d90197e98d29787a40966f248dd769c9dac28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90175 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 1e95c2c17a49349caba1e62b4de3752c5f767f01)
-rw-r--r--include/vcl/BitmapTools.hxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/vcl/BitmapTools.hxx b/include/vcl/BitmapTools.hxx
index c15fdf9e16b8..d30f16058755 100644
--- a/include/vcl/BitmapTools.hxx
+++ b/include/vcl/BitmapTools.hxx
@@ -53,7 +53,8 @@ public:
assert(nBitCount == 24 || nBitCount == 32);
sal_Int32 nRowSize, nDataSize;
if (o3tl::checked_multiply<sal_Int32>(rSize.getWidth(), nBitCount/8, nRowSize) ||
- o3tl::checked_multiply<sal_Int32>(nRowSize, rSize.getHeight(), nDataSize))
+ o3tl::checked_multiply<sal_Int32>(nRowSize, rSize.getHeight(), nDataSize) ||
+ nDataSize < 0)
{
throw std::bad_alloc();
}