use the same max size that libtiff defaults to for its own utilities

Change-Id: I67a769a6108fb8590d6304390a4f27ef95927c9b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149882
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
diff --git a/vcl/source/filter/itiff/itiff.cxx b/vcl/source/filter/itiff/itiff.cxx
index 0251f0b..19b3e46 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -154,7 +154,8 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic)
        }

        uint32_t nPixelsRequired;
        constexpr size_t nMaxPixelsAllowed = SAL_MAX_INT32/4;
        // use the same max size that libtiff defaults to for its own utilities
        constexpr size_t nMaxPixelsAllowed = (256 * 1024 * 1024) / 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);