diff options
author | James Zern <jzern@google.com> | 2018-09-17 12:32:58 -0700 |
---|---|---|
committer | James Zern <jzern@google.com> | 2018-09-17 12:41:33 -0700 |
commit | 42e48983aa0e6f34c9643e24da7215fdbb692ef6 (patch) | |
tree | dec6f78d7b947532be542b3fe0b3da2c452a3477 /vpx_mem/vpx_mem.c | |
parent | 2945e9ebfaa1387413f61d6bdbbf2d689f4e2a10 (diff) | |
download | libvpx-42e48983aa0e6f34c9643e24da7215fdbb692ef6.tar libvpx-42e48983aa0e6f34c9643e24da7215fdbb692ef6.tar.gz libvpx-42e48983aa0e6f34c9643e24da7215fdbb692ef6.tar.bz2 libvpx-42e48983aa0e6f34c9643e24da7215fdbb692ef6.zip |
vpx_mem: allow VPX_MAX_ALLOCABLE_MEMORY to be overridden
this allows the define to be set by the build environment
Change-Id: Ib40111c5d9bae417b031b8b40a7bc135c6734044
Diffstat (limited to 'vpx_mem/vpx_mem.c')
-rw-r--r-- | vpx_mem/vpx_mem.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vpx_mem/vpx_mem.c b/vpx_mem/vpx_mem.c index eeba34c37..18abf1158 100644 --- a/vpx_mem/vpx_mem.c +++ b/vpx_mem/vpx_mem.c @@ -16,12 +16,14 @@ #include "include/vpx_mem_intrnl.h" #include "vpx/vpx_integer.h" +#if !defined(VPX_MAX_ALLOCABLE_MEMORY) #if SIZE_MAX > (1ULL << 40) #define VPX_MAX_ALLOCABLE_MEMORY (1ULL << 40) #else // For 32-bit targets keep this below INT_MAX to avoid valgrind warnings. #define VPX_MAX_ALLOCABLE_MEMORY ((1ULL << 31) - (1 << 16)) #endif +#endif // Returns 0 in case of overflow of nmemb * size. static int check_size_argument_overflow(uint64_t nmemb, uint64_t size) { |