# libtiff: Merge branch 'issue-393' into 'master'

**URL:** <https://discourse.libsdl.org/t/libtiff-merge-branch-issue-393-into-master/35948>\
**Category:** SDL Commits\
**Created:** [May 7, 2022, 7:31pm UTC](https://discourse.libsdl.org/t/libtiff-merge-branch-issue-393-into-master/35948 "2022-05-07T19:31:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [May 7, 2022, 7:31pm UTC](https://discourse.libsdl.org/t/libtiff-merge-branch-issue-393-into-master/35948/1 "2022-05-07T19:31:01Z")

</div>

[https://github.com/libsdl-org/libtiff/commit/f8d0f9aa1ba04c9ae3bfe869a18141a8b8117ad7](https://github.com/libsdl-org/libtiff/commit/f8d0f9aa1ba04c9ae3bfe869a18141a8b8117ad7)

```diff
From 32ea0722ee68f503b7a3f9b2d557acb293fc8cde Mon Sep 17 00:00:00 2001
From: 4ugustus <[EMAIL REDACTED]>
Date: Tue, 8 Mar 2022 16:22:04 +0000
Subject: [PATCH] fix the FPE in tiffcrop (#393)

---
 libtiff/tif_dir.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libtiff/tif_dir.c b/libtiff/tif_dir.c
index 57055ca9..59b346ca 100644
--- a/libtiff/tif_dir.c
+++ b/libtiff/tif_dir.c
@@ -333,13 +333,13 @@ _TIFFVSetField(TIFF* tif, uint32_t tag, va_list ap)
 		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;

```
