projects
/
libopano.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
panolib.c: Fixed argument-checking in the bilinear interpolation.
[libopano.git]
/
src
/
panolib.c
diff --git
a/src/panolib.c
b/src/panolib.c
index
2686059
..
6d503d6
100644
(file)
--- 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;
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;
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;
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));
assert ((x_right_frac >= 0.0) && (x_right_frac <= 1.0));
assert ((y_bottom_frac >= 0.0) && (y_bottom_frac <= 1.0));