mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-16 13:59:51 +02:00
utils.h: add SizeOverflow()
this normalizes the 'size != (size_t)size' checks in the libraries. Change-Id: I1e8ccd0d3697266f23911ecf0f7a546f011befde
This commit is contained in:
@ -705,7 +705,7 @@ static int AllocateMemory(VP8Decoder* const dec) {
|
||||
+ cache_size + alpha_size + WEBP_ALIGN_CST;
|
||||
uint8_t* mem;
|
||||
|
||||
if (needed != (size_t)needed) return 0; // check for overflow
|
||||
if (!CheckSizeOverflow(needed)) return 0; // check for overflow
|
||||
if (needed > dec->mem_size_) {
|
||||
WebPSafeFree(dec->mem_);
|
||||
dec->mem_size_ = 0;
|
||||
|
Reference in New Issue
Block a user