summaryrefslogtreecommitdiff
path: root/tiff/libtiff/tif_aux.c
diff options
context:
space:
mode:
Diffstat (limited to 'tiff/libtiff/tif_aux.c')
-rw-r--r--tiff/libtiff/tif_aux.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/tiff/libtiff/tif_aux.c b/tiff/libtiff/tif_aux.c
index 3d35ba92b..10b8d00c2 100644
--- a/tiff/libtiff/tif_aux.c
+++ b/tiff/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: