From 1120a2d578bc51bd34fadfe6471f7c24c61d580a Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 10 Mar 2020 16:31:41 +0100 Subject: [PATCH] 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 --- libtiff/tif_ojpeg.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/libtiff/tif_ojpeg.c b/libtiff/tif_ojpeg.c index aa5ff5e2..b1f6a948 100644 --- a/libtiff/tif_ojpeg.c +++ b/libtiff/tif_ojpeg.c @@ -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 ||