void* WebPSafeCalloc(uint64_t nmemb, size_t size) { void* ptr; Increment(&num_calloc_calls); if (!CheckSizeArgumentsOverflow(nmemb, size)) return NULL; assert(nmemb * size > 0); ptr = calloc((size_t)nmemb, size); AddMem(ptr, (size_t)(nmemb * size)); return ptr; }
void* BrotliSafeMalloc(uint64_t nmemb, size_t size) { if (!CheckSizeArgumentsOverflow(nmemb, size)) return NULL; assert(nmemb * size > 0); return malloc((size_t)(nmemb * size)); }
void* WebPSafeCalloc(uint64_t nmemb, size_t size) { if (!CheckSizeArgumentsOverflow(nmemb, size)) return NULL; assert(nmemb * size > 0); return calloc((size_t)nmemb, size); }