1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-16 14:00:40 +00:00

Update libwebp to 0.5.2

(cherry picked from commit e04c7e11ec)
This commit is contained in:
volzhs
2016-12-22 09:54:15 +09:00
committed by Rémi Verschelde
parent 0701e7c2d8
commit 5698571235
28 changed files with 311 additions and 230 deletions

View File

@@ -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