File tiff-CVE-2022-34526.patch of Package tiff.32960

Index: tiff-4.0.9/libtiff/tif_dirinfo.c
===================================================================
--- tiff-4.0.9.orig/libtiff/tif_dirinfo.c
+++ tiff-4.0.9/libtiff/tif_dirinfo.c
@@ -983,6 +983,9 @@ _TIFFCheckFieldIsValidForCodec(TIFF *tif
 	    default:
 		return 1;
 	}
+	if( !TIFFIsCODECConfigured(tif->tif_dir.td_compression) ) {
+		return 0;
+	}
 	/* Check if codec specific tags are allowed for the current
 	 * compression scheme (codec) */
 	switch (tif->tif_dir.td_compression) {
openSUSE Build Service is sponsored by