summaryrefslogtreecommitdiff
path: root/third_party/libtiff/0026-upstream-null-dereference.patch
blob: 052645ff8a7ba8f7df5715217a1cc7c05f122ad4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/third_party/libtiff/tif_getimage.c b/third_party/libtiff/tif_getimage.c
index 03c9a81fb..d37f729c4 100644
--- a/third_party/libtiff/tif_getimage.c
+++ b/third_party/libtiff/tif_getimage.c
@@ -681,7 +681,7 @@ gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
        return (0);
     }
     leftmost_toskew = safeskew;
-    for (row = 0; row < h; row += nrow)
+    for (row = 0; ret != 0 && row < h; row += nrow)
     {
         rowstoread = th - (row + img->row_offset) % th;
        nrow = (row + rowstoread > h ? h - row : rowstoread);
@@ -830,7 +830,7 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
        leftmost_fromskew = img->col_offset % tw;
        leftmost_tw = tw - leftmost_fromskew;
        leftmost_toskew = toskew + leftmost_fromskew;
-       for (row = 0; row < h; row += nrow)
+       for (row = 0; ret != 0 && row < h; row += nrow)
        {
                rowstoread = th - (row + img->row_offset) % th;
                nrow = (row + rowstoread > h ? h - row : rowstoread);