File tiff-CVE-2022-0909.patch of Package tiff.32962
Index: tiff-4.0.9/libtiff/tif_dir.c
===================================================================
--- tiff-4.0.9.orig/libtiff/tif_dir.c
+++ tiff-4.0.9/libtiff/tif_dir.c
@@ -332,13 +332,13 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va
break;
case TIFFTAG_XRESOLUTION:
dblval = va_arg(ap, double);
- if( dblval < 0 )
+ if( dblval != dblval || dblval < 0 )
goto badvaluedouble;
td->td_xresolution = TIFFClampDoubleToFloat( dblval );
break;
case TIFFTAG_YRESOLUTION:
dblval = va_arg(ap, double);
- if( dblval < 0 )
+ if( dblval != dblval || dblval < 0 )
goto badvaluedouble;
td->td_yresolution = TIFFClampDoubleToFloat( dblval );
break;