vcl/source/filter/itiff/itiff.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 8907b6a04e900a05efb2e8ae5b5ac4738e67c1f8
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri Jun 3 15:45:57 2022 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sat Jun 4 17:17:28 2022 +0200

    ofz#47759 Timeout
    
    Change-Id: I8d6b1adb83963c229d71b9f593d39d8cd3e281e3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135363
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/vcl/source/filter/itiff/itiff.cxx 
b/vcl/source/filter/itiff/itiff.cxx
index 74c0b55b1b59..d8895b8cff31 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -20,6 +20,7 @@
 #include <sal/config.h>
 #include <sal/log.hxx>
 
+#include <comphelper/scopeguard.hxx>
 #include <vcl/graph.hxx>
 #include <vcl/BitmapTools.hxx>
 #include <vcl/animate/Animation.hxx>
@@ -104,6 +105,13 @@ static toff_t tiff_size(thandle_t handle)
 
 bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic)
 {
+    auto origErrorHandler = TIFFSetErrorHandler(nullptr);
+    auto origWarningHandler = TIFFSetWarningHandler(nullptr);
+    comphelper::ScopeGuard restoreDefaultHandlers([&]() {
+        TIFFSetErrorHandler(origErrorHandler);
+        TIFFSetWarningHandler(origWarningHandler);
+    });
+
     Context aContext(rTIFF, rTIFF.remainingSize());
     TIFF* tif = TIFFClientOpen("libtiff-svstream", "r", &aContext,
                                tiff_read, tiff_write,

Reply via email to