--- tiff-4.0.6/tools/gif2tiff.c 2015-08-28 15:17:08.160498720 -0700 +++ tiff-4.0.6/tools/gif2tiff.c 2016-09-22 13:24:48.282780274 -0700 @@ -349,7 +349,7 @@ int status = 1; (void) getc(infile); - while ((count = getc(infile)) && count <= 255) + while ((count = getc(infile)) && count >= 0 && count <= 255) if (fread(buf, 1, count, infile) != (size_t) count) { fprintf(stderr, "short read from file %s (%s)\n", filename, strerror(errno));