File ImageMagick-CVE-2019-13136.patch of Package ImageMagick.24236

diff --git a/coders/tiff.c b/coders/tiff.c
index 7efbb970b5..97402f2cb3 100644
--- a/coders/tiff.c
+++ b/coders/tiff.c
@@ -258,6 +258,12 @@ static MagickOffsetType TIFFSeekCustomStream(const MagickOffsetType offset,
     }
     case SEEK_CUR:
     {
+      if (((offset > 0) && (profile->offset > (SSIZE_MAX-offset))) ||
+          ((offset < 0) && (profile->offset < (-SSIZE_MAX-offset))))
+        {
+          errno=EOVERFLOW;
+          return(-1);
+        }
       if ((profile->offset+offset) < 0)
         return(-1);
       profile->offset+=offset;

openSUSE Build Service is sponsored by