MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / stbi__mad2sizes_valid

Function stbi__mad2sizes_valid

include/stb/stb_image.h:1024–1027  ·  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

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