summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-28 16:43:28 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-01-28 21:36:48 +0100
commit090cf1e3bbe0ffaf56f22b152b73578483be2f42 (patch)
treef0d2734da623cff5c9206dd9db3b25acf6310700 /filter
parentae01adf0747496e8c36f8f30fc2c1a4a6ef8275e (diff)
ofz#20366 OOM
Change-Id: If658720502739e6ad88c3cf73ac6674e0313a48b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87648 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/icgm/bitmap.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/filter/source/graphicfilter/icgm/bitmap.cxx b/filter/source/graphicfilter/icgm/bitmap.cxx
index e99349c1684d..3075cf733e48 100644
--- a/filter/source/graphicfilter/icgm/bitmap.cxx
+++ b/filter/source/graphicfilter/icgm/bitmap.cxx
@@ -330,7 +330,15 @@ bool CGMBitmap::ImplGetDimensions( CGMBitmapDescriptor& rDesc )
rDesc.mbStatus = false;
sal_uInt32 nHeaderSize = 2 + 3 * nPrecision + 3 * mpCGM->ImplGetPointSize();
- rDesc.mnScanSize = ( ( rDesc.mnX * rDesc.mnDstBitsPerPixel + 7 ) >> 3 );
+
+ sal_uInt32 nWidthBits;
+ if (o3tl::checked_multiply(rDesc.mnX, rDesc.mnDstBitsPerPixel, nWidthBits))
+ {
+ rDesc.mbStatus = false;
+ return false;
+ }
+
+ rDesc.mnScanSize = (nWidthBits + 7) >> 3;
sal_uInt32 nScanSize;
nScanSize = rDesc.mnScanSize;