File CVE-2021-25289.patch of Package python-Pillow.35230

Index: Pillow-7.2.0/Tests/test_tiff_crashes.py
===================================================================
--- Pillow-7.2.0.orig/Tests/test_tiff_crashes.py
+++ Pillow-7.2.0/Tests/test_tiff_crashes.py
@@ -24,6 +24,8 @@ from .helper import on_ci
         "Tests/images/crash_1.tif",
         "Tests/images/crash_2.tif",
         "Tests/images/crash-2020-10-test.tif",
+        "Tests/images/crash-1152ec2d1a1a71395b6f2ce6721c38924d025bf3.tif",
+        "Tests/images/crash-0e16d3bfb83be87356d026d66919deaefca44dac.tif",
     ],
 )
 @pytest.mark.filterwarnings("ignore:Possibly corrupt EXIF data")
Index: Pillow-7.2.0/src/libImaging/TiffDecode.c
===================================================================
--- Pillow-7.2.0.orig/src/libImaging/TiffDecode.c
+++ Pillow-7.2.0/src/libImaging/TiffDecode.c
@@ -305,7 +305,7 @@ int _decodeStripYCbCr(Imaging im, Imagin
         img.row_offset = state->y; 
         rows_to_read = min(rows_per_strip, img.height - state->y);
 
-        if (TIFFRGBAImageGet(&img, (UINT32 *)state->buffer, img.width, rows_to_read) == -1) {
+        if (!TIFFRGBAImageGet(&img, (UINT32 *)state->buffer, img.width, rows_to_read)) {
             TRACE(("Decode Error, y: %d\n", state->y ));
             state->errcode = IMAGING_CODEC_BROKEN;
             TIFFRGBAImageEnd(&img);
openSUSE Build Service is sponsored by