From e04c7e11ec2fabf34aaf515103bc0b6086e1aabd Mon Sep 17 00:00:00 2001 From: volzhs Date: Thu, 22 Dec 2016 09:54:15 +0900 Subject: Update libwebp to 0.5.2 --- thirdparty/libwebp/utils/utils.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'thirdparty/libwebp/utils/utils.c') diff --git a/thirdparty/libwebp/utils/utils.c b/thirdparty/libwebp/utils/utils.c index 2602ca3c9f..82dbf8d5e5 100644 --- a/thirdparty/libwebp/utils/utils.c +++ b/thirdparty/libwebp/utils/utils.c @@ -175,8 +175,12 @@ static int CheckSizeArgumentsOverflow(uint64_t nmemb, size_t size) { } #endif #if defined(MALLOC_LIMIT) - if (mem_limit > 0 && total_mem + total_size >= mem_limit) { - return 0; // fake fail! + if (mem_limit > 0) { + const uint64_t new_total_mem = (uint64_t)total_mem + total_size; + if (new_total_mem != (size_t)new_total_mem || + new_total_mem > mem_limit) { + return 0; // fake fail! + } } #endif -- cgit v1.2.3