MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / stbi__malloc_mad2

Function stbi__malloc_mad2

lite/example/cpp_example/mge/cv/stb_image.h:1074–1078  ·  view source on GitHub ↗

mallocs with size overflow checking

Source from the content-addressed store, hash-verified

1072 !defined(STBI_NO_HDR)
1073// mallocs with size overflow checking
1074static void* stbi__malloc_mad2(int a, int b, int add) {
1075 if (!stbi__mad2sizes_valid(a, b, add))
1076 return NULL;
1077 return stbi__malloc(a * b + add);
1078}
1079#endif
1080
1081static void* stbi__malloc_mad3(int a, int b, int c, int add) {

Callers 4

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