HW5 Camera/HW5 Camera/stb_image.h
// returns 1 if the product is valid, 0 on overflow.
// negative factors are considered invalid.
returns 1 if the product is valid, 0 on overflow.
negative factors are considered invalid.
returns 1 if the product is valid 0 on overflow . negative factors are considered invalid .
static int stbi__mul2sizes_valid(int a, int b)
{
	if (a < 0 || b < 0) return 0;
	if (b == 0) return 1; 
	return a <= INT_MAX / b;
}
static int stbi__mul2sizes_valid ( int a , int b ) { if ( a < 0 || b < 0 ) return 0 ; if ( b == 0 ) return 1 ; return a <= INT_MAX / b ; }
returns 1 if the product is valid, 0 on overflow.
returns 1 if the product is valid 0 on overflow .
// mul-by-0 is always safe // portable way to check for no overflows in a*b