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

Function stbi__mad4sizes_valid

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

Source from the content-addressed store, hash-verified

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)
1064static int stbi__mad4sizes_valid(int a, int b, int c, int d, int add) {
1065 return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a * b, c) &&
1066 stbi__mul2sizes_valid(a * b * c, d) &&
1067 stbi__addsizes_valid(a * b * c * d, add);
1068}
1069#endif
1070
1071#if !defined(STBI_NO_JPEG) || !defined(STBI_NO_PNG) || !defined(STBI_NO_TGA) || \

Callers 3

stbi__malloc_mad4Function · 0.85
stbi__hdr_loadFunction · 0.85
stbi__pnm_loadFunction · 0.85

Calls 2

stbi__mul2sizes_validFunction · 0.85
stbi__addsizes_validFunction · 0.85

Tested by

no test coverage detected