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

Function stbi__mad2sizes_valid

Source/Utils/stb_image.h:1023–1026  ·  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

1021#if !defined(STBI_NO_JPEG) || !defined(STBI_NO_PNG) || !defined(STBI_NO_TGA) || !defined(STBI_NO_HDR)
1022// returns 1 if "a*b + add" has no negative terms/factors and doesn't overflow
1023static int stbi__mad2sizes_valid(int a, int b, int add)
1024{
1025 return stbi__mul2sizes_valid(a, b) && stbi__addsizes_valid(a*b, add);
1026}
1027#endif
1028
1029// returns 1 if "a*b*c + add" has no negative terms/factors and doesn't overflow

Callers 2

stbi__malloc_mad2Function · 0.85

Calls 2

stbi__mul2sizes_validFunction · 0.85
stbi__addsizes_validFunction · 0.85

Tested by

no test coverage detected