MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / stbi__malloc_mad2

Function stbi__malloc_mad2

include/stb/stb_image.h:1048–1052  ·  view source on GitHub ↗

mallocs with size overflow checking

Source from the content-addressed store, hash-verified

1046#if !defined(STBI_NO_JPEG) || !defined(STBI_NO_PNG) || !defined(STBI_NO_TGA) || !defined(STBI_NO_HDR)
1047// mallocs with size overflow checking
1048static void *stbi__malloc_mad2(int a, int b, int add)
1049{
1050 if (!stbi__mad2sizes_valid(a, b, add)) return NULL;
1051 return stbi__malloc(a*b + add);
1052}
1053#endif
1054
1055static void *stbi__malloc_mad3(int a, int b, int c, int add)

Callers 5

stbi__expand_png_paletteFunction · 0.85
stbi__tga_loadFunction · 0.85
stbi__hdr_loadFunction · 0.85

Calls 2

stbi__mad2sizes_validFunction · 0.85
stbi__mallocFunction · 0.85

Tested by

no test coverage detected