https://gitlab.com/libtiff/libtiff/-/merge_requests/757
Index: tiff-4.0.9/tools/tiffcrop.c
===================================================================
--- tiff-4.0.9.orig/tools/tiffcrop.c
+++ tiff-4.0.9/tools/tiffcrop.c
@@ -3828,7 +3828,7 @@ combineSeparateSamplesBytes (unsigned ch
     {
     if ((dumpfile != NULL) && (level == 2))
       {
-      for (s = 0; s < spp; s++)
+      for (s = 0; (s < spp) && (s < MAX_SAMPLES); s++)
         {
         dump_info (dumpfile, format, "combineSeparateSamplesBytes","Input data, Sample %d", s);
         dump_buffer(dumpfile, format, 1, cols, row, srcbuffs[s] + (row * src_rowsize));
