37 lines
838 B
Diff
37 lines
838 B
Diff
From b0e1c25dd1d065200c8d8f59ad0afe014861a1b9 Mon Sep 17 00:00:00 2001
|
|
From: Su_Laus <sulau@freenet.de>
|
|
Date: Thu, 16 Feb 2023 12:03:16 +0100
|
|
Subject: [PATCH] tif_luv: Check and correct for NaN data in uv_encode().
|
|
|
|
Closes #530
|
|
|
|
See merge request !473
|
|
|
|
Reference:https://gitlab.com/libtiff/libtiff/-/merge_requests/473/diffs
|
|
Conflict:NA
|
|
|
|
---
|
|
libtiff/tif_luv.c | 7 +++++++
|
|
1 file changed, 7 insertions(+)
|
|
|
|
diff --git a/libtiff/tif_luv.c b/libtiff/tif_luv.c
|
|
index 051721e82..021756d5d 100644
|
|
--- a/libtiff/tif_luv.c
|
|
+++ b/libtiff/tif_luv.c
|
|
@@ -953,6 +953,13 @@ static
|
|
{
|
|
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 = tiff_itrunc((v - UV_VSTART) * (1. / UV_SQSIZ), em);
|
|
--
|
|
GitLab
|