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

Function stbi__mad3sizes_valid

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

1028
1029// returns 1 if "a*b*c + add" has no negative terms/factors and doesn't overflow
1030static int stbi__mad3sizes_valid(int a, int b, int c, int add)
1031{
1032 return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a*b, c) &&
1033 stbi__addsizes_valid(a*b*c, add);
1034}
1035
1036// returns 1 if "a*b*c*d + add" has no negative terms/factors and doesn't overflow
1037#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