diff options
author | Bob Friesenhahn <bfriesen@simple.dallas.tx.us> | 2015-09-05 20:31:41 +0000 |
---|---|---|
committer | Bob Friesenhahn <bfriesen@simple.dallas.tx.us> | 2015-09-05 20:31:41 +0000 |
commit | 2c7bbbc1630c8291e8c3bf164d7c29ef0eb3c7c6 (patch) | |
tree | 8364d0d9d8f8c528cac3021cab887e51fa2cd4fb | |
parent | 6fcb0cfb03af26e10aaec5a68725e0c34fc4b4a7 (diff) | |
download | libtiff-git-2c7bbbc1630c8291e8c3bf164d7c29ef0eb3c7c6.tar.gz |
(TIFF_UINT32_MAX): Avoid use of platform-specific large constants.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | libtiff/tif_dirread.c | 10 |
2 files changed, 4 insertions, 7 deletions
@@ -5,6 +5,7 @@ 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. + (TIFF_UINT32_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 81a61be9..a0dc68b7 100644 --- a/libtiff/tif_dirread.c +++ b/libtiff/tif_dirread.c @@ -1,4 +1,4 @@ -/* $Id: tif_dirread.c,v 1.190 2015-09-05 20:22:45 bfriesen Exp $ */ +/* $Id: tif_dirread.c,v 1.191 2015-09-05 20:31:41 bfriesen Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -3174,11 +3174,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSlong(int32 value) /* * Largest 32-bit unsigned integer value. */ -#if defined(__WIN32__) && defined(_MSC_VER) -# define TIFF_UINT32_MAX 0xFFFFFFFFI64 -#else -# define TIFF_UINT32_MAX 0xFFFFFFFFLL -#endif +#define TIFF_UINT32_MAX 0xFFFFFFFFU static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongLong8(uint64 value) @@ -3192,7 +3188,7 @@ TIFFReadDirEntryCheckRangeLongLong8(uint64 value) static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSlong8(int64 value) { - if ((value<0) || (value > TIFF_UINT32_MAX)) + if ((value < 0) || (value > (int64) TIFF_UINT32_MAX)) return(TIFFReadDirEntryErrRange); else return(TIFFReadDirEntryErrOk); |