[Libreoffice-commits] core.git: filter/source
Caolán McNamara
caolanm at redhat.com
Tue Feb 13 14:38:57 UTC 2018
filter/source/graphicfilter/iras/iras.cxx | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
New commits:
commit 7cdbe677c8129005cd596b307b78b23d7443fb90
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Feb 13 12:09:22 2018 +0000
ofz#6282 oom Abrt
Change-Id: I35a9681df5a99d51fd3c40d9a4b0a85780c090f2
Reviewed-on: https://gerrit.libreoffice.org/49641
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/filter/source/graphicfilter/iras/iras.cxx b/filter/source/graphicfilter/iras/iras.cxx
index 251c3cf480b3..6dca245c2ba3 100644
--- a/filter/source/graphicfilter/iras/iras.cxx
+++ b/filter/source/graphicfilter/iras/iras.cxx
@@ -167,10 +167,11 @@ bool RASReader::ReadRAS(Graphic & rGraphic)
//for the sake of simplicity we'll assume that RAS_TYPE_BYTE_ENCODED can
//describe data 255 times larger than the data stored
size_t nMaxCompression = mnType != RAS_TYPE_BYTE_ENCODED ? 1 : 255;
- if (m_rRAS.remainingSize() * nMaxCompression < static_cast<sal_uInt64>(mnHeight) * mnWidth * mnDepth / 8)
- {
+ sal_uInt32 nBitSize;
+ if (o3tl::checked_multiply<sal_uInt32>(mnWidth, mnHeight, nBitSize) || o3tl::checked_multiply<sal_uInt32>(nBitSize, mnDepth, nBitSize))
+ return false;
+ if (m_rRAS.remainingSize() * nMaxCompression < nBitSize / 8)
return false;
- }
vcl::bitmap::RawBitmap aBmp(Size(mnWidth, mnHeight));
More information about the Libreoffice-commits
mailing list