X-Git-Url: https://git.octo.it/?p=libopano.git;a=blobdiff_plain;f=src%2Fpanolib.c;fp=src%2Fpanolib.c;h=6d503d6c36ff3afc22fb554a91c5904d2599abf0;hp=26860597ef137d1cac383d35fa0636f6631df384;hb=37da36e515306b3a538731220ee25f665071e892;hpb=6daddf39485747a5aa004a3a0a7d7a893807def1 diff --git a/src/panolib.c b/src/panolib.c index 2686059..6d503d6 100644 --- a/src/panolib.c +++ b/src/panolib.c @@ -91,16 +91,16 @@ static int copy_pixel (ui_image_t *dest, const ui_image_t *src, 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));