int i;
x_src_left = (int) x_src_fp;
- x_src_right = x_src_left + 1;
+ x_src_right = (x_src_left + 1) % src->width;
+
y_src_top = (int) y_src_fp;
y_src_bottom = y_src_top + 1;
+ if (y_src_bottom >= src->height)
+ y_src_bottom = src->height - 1;
x_right_frac = x_src_fp - x_src_left;
y_bottom_frac = y_src_fp - y_src_top;
- assert (x_src_right < src->width);
- assert (y_src_bottom < src->height);
-
assert ((x_right_frac >= 0.0) && (x_right_frac <= 1.0));
assert ((y_bottom_frac >= 0.0) && (y_bottom_frac <= 1.0));