File tiff-CVE-2023-26966.patch of Package tiff.34105

Index: tiff-4.0.9/libtiff/tif_luv.c
===================================================================
--- tiff-4.0.9.orig/libtiff/tif_luv.c
+++ tiff-4.0.9/libtiff/tif_luv.c
@@ -918,6 +918,13 @@ uv_encode(double u, double v, int em)	/*
 {
 	register int	vi, ui;
 
+	/* check for NaN */
+    if (u != u || v != v)
+    {
+        u = U_NEU;
+        v = V_NEU;
+    }
+
 	if (v < UV_VSTART)
 		return oog_encode(u, v);
 	vi = itrunc((v - UV_VSTART)*(1./UV_SQSIZ), em);
openSUSE Build Service is sponsored by