Blame SOURCES/0027-CVE-2022-0909-fix-the-FPE-in-tiffcrop-393.patch

edc570
From fb2bd72a49496d10c4860102b7c26b9bc8adff70 Mon Sep 17 00:00:00 2001
edc570
From: 4ugustus <wangdw.augustus@qq.com>
edc570
Date: Tue, 8 Mar 2022 16:22:04 +0000
edc570
Subject: [PATCH] (CVE-2022-0909) fix the FPE in tiffcrop (#393)
edc570
edc570
(cherry picked from commit 32ea0722ee68f503b7a3f9b2d557acb293fc8cde)
edc570
---
edc570
 libtiff/tif_dir.c | 4 ++--
edc570
 1 file changed, 2 insertions(+), 2 deletions(-)
edc570
edc570
diff --git a/libtiff/tif_dir.c b/libtiff/tif_dir.c
edc570
index c36a5f3f..f126f2aa 100644
edc570
--- a/libtiff/tif_dir.c
edc570
+++ b/libtiff/tif_dir.c
edc570
@@ -320,13 +320,13 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
edc570
 		break;
edc570
 	case TIFFTAG_XRESOLUTION:
edc570
         dblval = va_arg(ap, double);
edc570
-        if( dblval < 0 )
edc570
+        if( dblval != dblval || dblval < 0 )
edc570
             goto badvaluedouble;
edc570
 		td->td_xresolution = TIFFClampDoubleToFloat( dblval );
edc570
 		break;
edc570
 	case TIFFTAG_YRESOLUTION:
edc570
         dblval = va_arg(ap, double);
edc570
-        if( dblval < 0 )
edc570
+        if( dblval != dblval || dblval < 0 )
edc570
             goto badvaluedouble;
edc570
 		td->td_yresolution = TIFFClampDoubleToFloat( dblval );
edc570
 		break;