libtiff: Really reset the tag count in CheckDirCount() to expected value as the warning

https://github.com/libsdl-org/libtiff/commit/8b86bc0781571d23dcae351e951a96ddee472256

From 8b86bc0781571d23dcae351e951a96ddee472256 Mon Sep 17 00:00:00 2001
From: Andrey Kiselev <[EMAIL REDACTED]>
Date: Wed, 7 Jul 2010 15:13:19 +0000
Subject: [PATCH] Really reset the tag count in CheckDirCount() to expected
 value as the warning message suggests. As per bug
 http://bugzilla.maptools.org/show_bug.cgi?id=1963

---
 ChangeLog             | 4 ++++
 libtiff/tif_dirread.c | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 43ceaf47..fbd6f565 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-07-07  Andrey Kiselev  <dron@ak4719.spb.edu>
 
+	* lintiff/tif_dirread.c: Really reset the tag count in CheckDirCount()
+	to expected value as the warning message suggests. As per bug
+	http://bugzilla.maptools.org/show_bug.cgi?id=1963
+
 	* tools/tiffdump.c: Avoid integer overflows computing the buffer size
 	for large directories. As per bug
 	http://bugzilla.maptools.org/show_bug.cgi?id=2218
diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
index 907b5318..4b7f9311 100644
--- a/libtiff/tif_dirread.c
+++ b/libtiff/tif_dirread.c
@@ -1,4 +1,4 @@
-/* $Id: tif_dirread.c,v 1.92.2.9 2010-06-14 00:21:46 fwarmerdam Exp $ */
+/* $Id: tif_dirread.c,v 1.92.2.10 2010-07-07 15:13:19 dron Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -1086,6 +1086,7 @@ CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32 count)
 	"incorrect count for field \"%s\" (%u, expecting %u); tag trimmed",
 		    _TIFFFieldWithTag(tif, dir->tdir_tag)->field_name,
 		    dir->tdir_count, count);
+		dir->tdir_count = count;
 		return (1);
 	}
 	return (1);