summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-05-30 15:17:04 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-05-30 17:57:01 +0200
commitf3df14cc4343ce65608436acfa67b2ccfb68115d (patch)
treec6f1ff46303b4b49b7df61c04b9d6fad8dbbe636 /vcl
parent9104861a41e0edd07e4d74da47acb4e9d92b1ddd (diff)
ofz#47664 OOM
Change-Id: If0d1ea55a194961fdb05ed2023bcfdaa6f933bfa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135129 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/itiff/itiff.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/source/filter/itiff/itiff.cxx b/vcl/source/filter/itiff/itiff.cxx
index 6f81dffd08ef..9c0b6efff6b6 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -137,9 +137,10 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic)
}
uint32_t nPixelsRequired;
- if (o3tl::checked_multiply(w, h, nPixelsRequired))
+ bool bOk = !o3tl::checked_multiply(w, h, nPixelsRequired) && nPixelsRequired <= SAL_MAX_INT32/4;
+ if (!bOk)
{
- SAL_WARN("filter.tiff", "skipping oversized tiff image");
+ SAL_WARN("filter.tiff", "skipping oversized tiff image " << w << " x " << h);
break;
}