Resolves: tdf#160635 allow larger tiff images
Change-Id: I67a21877e7e75c2753218a7e6c978f691d679583
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168720
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
diff --git a/vcl/source/filter/itiff/itiff.cxx b/vcl/source/filter/itiff/itiff.cxx
index 741be4c..af5d88a 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -155,8 +155,7 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic)
}
uint32_t nPixelsRequired;
// use the same max size that libtiff defaults to for its own utilities
constexpr size_t nMaxPixelsAllowed = (256 * 1024 * 1024) / 4;
constexpr size_t nMaxPixelsAllowed = SAL_MAX_INT32/4;
// two buffers currently required, so limit further
bool bOk = !o3tl::checked_multiply(w, h, nPixelsRequired) && nPixelsRequired <= nMaxPixelsAllowed / 2;
SAL_WARN_IF(!bOk, "filter.tiff", "skipping oversized tiff image " << w << " x " << h);