Fix tiff2ps error regarding "Inconsistent value of es" by allowing es to be zero.

Problem was reported to the tiff mailing list by Julian H. Stacey on January 5, 2019.
This commit is contained in:
Bob Friesenhahn 2019-01-05 13:56:09 -06:00
parent 56a1976e92
commit a0e273fdca

View File

@ -2444,9 +2444,9 @@ PSDataColorContig(FILE* fd, TIFF* tif, uint32 w, uint32 h, int nc)
unsigned char *cp, c;
(void) w;
if( es <= 0 )
if( es < 0 )
{
TIFFError(filename, "Inconsistent value of es: %d", es);
TIFFError(filename, "Inconsistent value of es: %d (samplesperpixel=%u, nc=%d)", es, samplesperpixel, nc);
return;
}
tf_buf = (unsigned char *) _TIFFmalloc(tf_bytesperrow);