MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / stbi__malloc_mad2

Function stbi__malloc_mad2

Source/Utils/stb_image.h:1047–1051  ·  view source on GitHub ↗

mallocs with size overflow checking

Source from the content-addressed store, hash-verified

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