diff options
author | bfriesen <bfriesen> | 2015-09-05 20:22:45 +0000 |
---|---|---|
committer | bfriesen <bfriesen> | 2015-09-05 20:22:45 +0000 |
commit | 61740f84513932ec899f24f51bf65d68ffa59045 (patch) | |
tree | 5b72c645ee5fd5a456cb358177fd9be042650b21 | |
parent | be204521b6361062ed28ed97e7f897ae5829a80c (diff) | |
download | libtiff-61740f84513932ec899f24f51bf65d68ffa59045.tar.gz |
(TIFF_INT64_MAX): Avoid use of platform-specific large constants.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | libtiff/tif_dirread.c | 8 |
2 files changed, 3 insertions, 6 deletions
@@ -4,6 +4,7 @@ Change implementation so that it does not sometimes overflow the range of a 32-bit int and to avoid a signed vs unsigned compare compiler warning. + (TIFF_INT64_MAX): Avoid use of platform-specific large constants. 2015-09-01 Bob Friesenhahn <bfriesen@simple.dallas.tx.us> diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c index b30740d1..81a61be9 100644 --- a/libtiff/tif_dirread.c +++ b/libtiff/tif_dirread.c @@ -1,4 +1,4 @@ -/* $Id: tif_dirread.c,v 1.189 2015-09-05 20:15:57 bfriesen Exp $ */ +/* $Id: tif_dirread.c,v 1.190 2015-09-05 20:22:45 bfriesen Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -3268,11 +3268,7 @@ TIFFReadDirEntryCheckRangeLong8Slong8(int64 value) /* * Largest 64-bit signed integer value. */ -#if defined(__WIN32__) && defined(_MSC_VER) -# define TIFF_INT64_MAX 0x7FFFFFFFFFFFFFFFI64 -#else -# define TIFF_INT64_MAX 0x7FFFFFFFFFFFFFFFLL -#endif +#define TIFF_INT64_MAX ((int64)(((uint64) ~0) >> 1)) static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlong8Long8(uint64 value) |