libtiff: Fix mode check before opening a file.

https://github.com/libsdl-org/libtiff/commit/1387dba91de8b81f6944cd697b8a6a72cc0c0904

From 1387dba91de8b81f6944cd697b8a6a72cc0c0904 Mon Sep 17 00:00:00 2001
From: Lee Howard <[EMAIL REDACTED]>
Date: Mon, 6 Dec 2010 16:54:22 +0000
Subject: [PATCH] Fix mode check before opening a file.

http://bugzilla.maptools.org/show_bug.cgi?id=1906
---
 libtiff/tif_open.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libtiff/tif_open.c b/libtiff/tif_open.c
index 3b3b2ce6..4ad04d2c 100644
--- a/libtiff/tif_open.c
+++ b/libtiff/tif_open.c
@@ -1,4 +1,4 @@
-/* $Id: tif_open.c,v 1.33.2.1 2010-06-08 18:50:42 bfriesen Exp $ */
+/* $Id: tif_open.c,v 1.33.2.2 2010-12-06 16:54:22 faxguy Exp $ */
 
 /*
  * Copyright (c) 1988-1997 Sam Leffler
@@ -304,7 +304,7 @@ TIFFClientOpen(
 	/*
 	 * Read in TIFF header.
 	 */
-	if (tif->tif_mode & O_TRUNC ||
+	if ((m & O_TRUNC) ||
 	    !ReadOK(tif, &tif->tif_header, sizeof (TIFFHeader))) {
 		if (tif->tif_mode == O_RDONLY) {
 			TIFFErrorExt(tif->tif_clientdata, name,