tif_ojpeg.c: relax again too strict sanity checks to allow reading of valid images such as https://gitlab.com/libtiff/libtiff/-/issues/181#note_302535232. Fixes #181
This commit is contained in:
parent
ae054d59ae
commit
1120a2d578
@ -1263,15 +1263,12 @@ OJPEGWriteHeaderInfo(TIFF* tif)
|
||||
}
|
||||
if (jpeg_start_decompress_encap(sp,&(sp->libjpeg_jpeg_decompress_struct))==0)
|
||||
return(0);
|
||||
if(sp->libjpeg_jpeg_decompress_struct.image_width != sp->strile_width ||
|
||||
sp->libjpeg_jpeg_decompress_struct.image_height < sp->strile_length) {
|
||||
if(sp->libjpeg_jpeg_decompress_struct.image_width != sp->strile_width ) {
|
||||
TIFFErrorExt(tif->tif_clientdata,module,
|
||||
"jpeg_start_decompress() returned image_width = %d "
|
||||
"and image_height = %d, expected %d and %d",
|
||||
"jpeg_start_decompress() returned image_width = %d, "
|
||||
"expected %d",
|
||||
sp->libjpeg_jpeg_decompress_struct.image_width,
|
||||
sp->libjpeg_jpeg_decompress_struct.image_height,
|
||||
sp->strile_width,
|
||||
sp->strile_length);
|
||||
sp->strile_width);
|
||||
return 0;
|
||||
}
|
||||
if(sp->libjpeg_jpeg_decompress_struct.max_h_samp_factor != sp->subsampling_hor ||
|
||||
|
Loading…
Reference in New Issue
Block a user