mirror of
https://github.com/webmproject/libwebp.git
synced 2025-08-29 23:32:05 +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:
@@ -42,6 +42,10 @@ extern "C" {
|
||||
#endif
|
||||
#endif // WEBP_MAX_ALLOCABLE_MEMORY
|
||||
|
||||
static WEBP_INLINE int CheckSizeOverflow(uint64_t size) {
|
||||
return size == (size_t)size;
|
||||
}
|
||||
|
||||
// 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
|
||||
// malloc(sizeof(foo)), but only if there's picture-dependent size involved
|
||||
|
Reference in New Issue
Block a user