Correct error message for invalid TIFF input
This commit is contained in:
parent
06f6911d7b
commit
46c1dd22fc
|
@ -825,18 +825,14 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
|
||||||
w= (int)tiWidth;
|
w= (int)tiWidth;
|
||||||
h= (int)tiHeight;
|
h= (int)tiHeight;
|
||||||
|
|
||||||
if((tiBps > 16U) || ((tiBps != 1U) && (tiBps & 1U))) tiBps = 0U;
|
if((tiBps > 16U) || ((tiBps != 1U) && (tiBps & 1U))) {
|
||||||
if(tiPhoto != PHOTOMETRIC_MINISBLACK && tiPhoto != PHOTOMETRIC_RGB) tiPhoto = 0;
|
fprintf(stderr,"tiftoimage: Bits=%d, Only 1, 2, 4, 6, 8, 10, 12, 14 and 16 bits implemented\n",tiBps);
|
||||||
|
fprintf(stderr,"\tAborting\n");
|
||||||
if( !tiBps || !tiPhoto)
|
TIFFClose(tif);
|
||||||
{
|
return NULL;
|
||||||
if( !tiBps)
|
}
|
||||||
fprintf(stderr,"tiftoimage: Bits=%d, Only 1, 2, 4, 6, 8, 10, 12, 14 and 16 bits implemented\n",tiBps);
|
if(tiPhoto != PHOTOMETRIC_MINISBLACK && tiPhoto != PHOTOMETRIC_RGB) {
|
||||||
else
|
fprintf(stderr,"tiftoimage: Bad color format %d.\n\tOnly RGB(A) and GRAY(A) has been implemented\n",(int) tiPhoto);
|
||||||
if( !tiPhoto)
|
|
||||||
fprintf(stderr,"tiftoimage: Bad color format %d.\n\tOnly RGB(A)"
|
|
||||||
" and GRAY(A) has been implemented\n",(int) tiPhoto);
|
|
||||||
|
|
||||||
fprintf(stderr,"\tAborting\n");
|
fprintf(stderr,"\tAborting\n");
|
||||||
TIFFClose(tif);
|
TIFFClose(tif);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue