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

Function stbi__mad2sizes_valid

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

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

Source from the content-addressed store, hash-verified

1049 !defined(STBI_NO_HDR)
1050// returns 1 if "a*b + add" has no negative terms/factors and doesn't overflow
1051static int stbi__mad2sizes_valid(int a, int b, int add) {
1052 return stbi__mul2sizes_valid(a, b) && stbi__addsizes_valid(a * b, add);
1053}
1054#endif
1055
1056// returns 1 if "a*b*c + add" has no negative terms/factors and doesn't overflow

Callers 1

stbi__malloc_mad2Function · 0.85

Calls 2

stbi__mul2sizes_validFunction · 0.85
stbi__addsizes_validFunction · 0.85

Tested by

no test coverage detected