summaryrefslogtreecommitdiff
path: root/third_party/libtiff/tif_aux.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/libtiff/tif_aux.c')
-rw-r--r--third_party/libtiff/tif_aux.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/third_party/libtiff/tif_aux.c b/third_party/libtiff/tif_aux.c
index 74532c8c6f..b1772f4c96 100644
--- a/third_party/libtiff/tif_aux.c
+++ b/third_party/libtiff/tif_aux.c
@@ -1,4 +1,4 @@
-/* $Id: tif_aux.c,v 1.29 2016-11-11 20:45:53 erouault Exp $ */
+/* $Id: tif_aux.c,v 1.31 2017-11-17 20:21:00 erouault Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
@@ -359,6 +359,13 @@ _TIFFUInt64ToDouble(uint64 ui64)
}
}
+int _TIFFSeekOK(TIFF* tif, toff_t off)
+{
+ /* Huge offsets, especially -1 / UINT64_MAX, can cause issues */
+ /* See http://bugzilla.maptools.org/show_bug.cgi?id=2726 */
+ return off <= (~(uint64)0)/2 && TIFFSeekFile(tif,off,SEEK_SET)==off;
+}
+
/* vim: set ts=8 sts=8 sw=8 noet: */
/*
* Local Variables: