rippletv: fix CLAMP end-values

This commit is contained in:
Stefan Sauer 2011-11-30 22:13:11 +01:00
parent cad107257c
commit c0e17dff4f

View file

@ -413,18 +413,18 @@ gst_rippletv_transform (GstBaseTransform * trans, GstBuffer * in,
v = (gint) vp[1];
dx = x + h;
dy = y + v;
dx = CLAMP (dx, 0, (v_w - 1));
dy = CLAMP (dy, 0, (v_h - 1));
dx = CLAMP (dx, 0, (v_w - 2));
dy = CLAMP (dy, 0, (v_h - 2));
dest[0] = src[dy * v_w + dx];
o_dx = dx;
dx = x + 1 + (h + (gint) vp[2]) / 2;
dx = CLAMP (dx, 0, (v_w - 1));
dx = CLAMP (dx, 0, (v_w - 2));
dest[1] = src[dy * v_w + dx];
dy = y + 1 + (v + (gint) vp[m_w * 2 + 1]) / 2;
dy = CLAMP (dy, 0, (v_h - 1));
dy = CLAMP (dy, 0, (v_h - 2));
dest[v_w] = src[dy * v_w + o_dx];
dest[v_w + 1] = src[dy * v_w + dx];