diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-03-07 19:24:42 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-05-05 13:16:03 +0200 |
commit | 460f1947ac6d95836f1044a375d136f4285693fa (patch) | |
tree | a1c162006a3feee79ffdeb05fea4daebef6847d5 /include | |
parent | 980f4da2b245c84e8f1e45e080bc80247afda945 (diff) |
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)
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/BitmapTools.hxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/vcl/BitmapTools.hxx b/include/vcl/BitmapTools.hxx index 75eb6ed53077..2ff0f69eea79 100644 --- a/include/vcl/BitmapTools.hxx +++ b/include/vcl/BitmapTools.hxx @@ -45,7 +45,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(); } |