https://gitlab.com/libtiff/libtiff/-/merge_requests/755
Index: tiff-4.0.9/tools/tiffcrop.c
===================================================================
--- tiff-4.0.9.orig/tools/tiffcrop.c
+++ tiff-4.0.9/tools/tiffcrop.c
@@ -2560,7 +2560,7 @@ main(int argc, char* argv[])
 
     if (dump.outfile != NULL)
       {
-      dump_info (dump.outfile, dump.format, "", "Completed run for %s", TIFFFileName(out));
+      dump_info (dump.outfile, dump.format, "", "Completed run for %s", out ? TIFFFileName(out) : "(not opened)");
       fclose (dump.outfile);
       }
     }
Index: tiff-4.0.9/tools/tiffdither.c
===================================================================
--- tiff-4.0.9.orig/tools/tiffdither.c
+++ tiff-4.0.9/tools/tiffdither.c
@@ -82,6 +82,11 @@ fsdither(TIFF* in, TIFF* out)
 	    fprintf(stderr, "Out of memory.\n");
 	    goto skip_on_error;
 	}
+	if (imagewidth > TIFFScanlineSize(in))
+    {
+        fprintf(stderr, "Image width exceeds scanline size.\n");
+        goto skip_on_error;
+    }
 
 	/*
 	 * Get first line
