diff options
author | volzhs <volzhs@gmail.com> | 2016-12-22 09:54:15 +0900 |
---|---|---|
committer | volzhs <volzhs@gmail.com> | 2016-12-24 00:46:09 +0900 |
commit | e04c7e11ec2fabf34aaf515103bc0b6086e1aabd (patch) | |
tree | 7e8e1947eb71efe8bf45632610ee2776c9ef0b3e /thirdparty/libwebp/utils/utils.h | |
parent | 2c8a1729152f5bcb1cb81d24b1e642634bff7174 (diff) | |
download | redot-engine-e04c7e11ec2fabf34aaf515103bc0b6086e1aabd.tar.gz |
Update libwebp to 0.5.2
Diffstat (limited to 'thirdparty/libwebp/utils/utils.h')
-rw-r--r-- | thirdparty/libwebp/utils/utils.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/thirdparty/libwebp/utils/utils.h b/thirdparty/libwebp/utils/utils.h index e0a81126df..3a5d4e6a78 100644 --- a/thirdparty/libwebp/utils/utils.h +++ b/thirdparty/libwebp/utils/utils.h @@ -20,6 +20,7 @@ #endif #include <assert.h> +#include <limits.h> #include "../dsp/dsp.h" #include "../webp/types.h" @@ -32,7 +33,14 @@ extern "C" { // Memory allocation // This is the maximum memory amount that libwebp will ever try to allocate. -#define WEBP_MAX_ALLOCABLE_MEMORY (1ULL << 40) +#ifndef WEBP_MAX_ALLOCABLE_MEMORY +#if SIZE_MAX > (1ULL << 34) +#define WEBP_MAX_ALLOCABLE_MEMORY (1ULL << 34) +#else +// For 32-bit targets keep this below INT_MAX to avoid valgrind warnings. +#define WEBP_MAX_ALLOCABLE_MEMORY ((1ULL << 31) - (1 << 16)) +#endif +#endif // WEBP_MAX_ALLOCABLE_MEMORY // size-checking safe malloc/calloc: verify that the requested size is not too // large, or return NULL. You don't need to call these for constructs like |