HW5 Camera/HW5 Camera/stb_image.h
// return 1 if the sum is valid, 0 on overflow.
// negative terms are considered invalid.
return 1 if the sum is valid, 0 on overflow.
negative terms are considered invalid.
return 1 if the sum is valid 0 on overflow . negative terms are considered invalid .
static int stbi__addsizes_valid(int a, int b)
{
	if (b < 0) return 0;
	return a <= INT_MAX - b;
}
static int stbi__addsizes_valid ( int a , int b ) { if ( b < 0 ) return 0 ; return a <= INT_MAX - b ; }
return 1 if the sum is valid, 0 on overflow.
return 1 if the sum is valid 0 on overflow .
// now 0 <= b <= INT_MAX, hence also // 0 <= INT_MAX - b <= INTMAX. // And "a + b <= INT_MAX" (which might overflow) is the // same as a <= INT_MAX - b (no overflow)