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

Function stbi__mad3sizes_valid

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

returns 1 if "a*b*c + add" has no negative terms/factors and doesn't overflow

Source from the content-addressed store, hash-verified

1055
1056// returns 1 if "a*b*c + add" has no negative terms/factors and doesn't overflow
1057static int stbi__mad3sizes_valid(int a, int b, int c, int add) {
1058 return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a * b, c) &&
1059 stbi__addsizes_valid(a * b * c, add);
1060}
1061
1062// returns 1 if "a*b*c*d + add" has no negative terms/factors and doesn't overflow
1063#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR) || !defined(STBI_NO_PNM)

Callers 8

stbi__malloc_mad3Function · 0.85
stbi__bmp_loadFunction · 0.85
stbi__tga_loadFunction · 0.85
stbi__psd_loadFunction · 0.85
stbi__pic_loadFunction · 0.85
stbi__gif_load_nextFunction · 0.85

Calls 2

stbi__mul2sizes_validFunction · 0.85
stbi__addsizes_validFunction · 0.85

Tested by

no test coverage detected