File tiff-CVE-2022-48281.patch of Package tiff.34105

Index: tiff-4.0.9/tools/tiffcrop.c
===================================================================
--- tiff-4.0.9.orig/tools/tiffcrop.c
+++ tiff-4.0.9/tools/tiffcrop.c
@@ -7572,7 +7572,7 @@ processCropSelections(struct image_data
         crop_buff = (unsigned char *)limitMalloc(cropsize + NUM_BUFF_OVERSIZE_BYTES);
       else
         {
-        prev_cropsize = seg_buffs[0].size;
+        prev_cropsize = seg_buffs[i].size;
         if (prev_cropsize < cropsize)
           {
           next_buff = _TIFFrealloc(crop_buff, cropsize + NUM_BUFF_OVERSIZE_BYTES);
openSUSE Build Service is sponsored by