Fixes off-by-one error that could cause crashes and uses a better way of interpolating/rounding that ensures, I think, that all the data will be taken into account when averaging pixels. Signed-off-by: Erling A. Jacobsen diff -ur xv-3.10a-orig/xvsmooth.c xv-3.10a/xvsmooth.c --- xv-3.10a-orig/xvsmooth.c 2008-02-24 20:13:53.000000000 +0100 +++ xv-3.10a/xvsmooth.c 2008-02-25 23:25:32.000000000 +0100 @@ -254,7 +254,7 @@ bperpix = (is24) ? 3 : 1; for (j=0; j<=swide; j++) - pixarr[j] = (j*dwide + (15*swide)/16) / swide; + pixarr[j] = ((2 * j + 1 ) * dwide) / ( 2 * swide); cptr = pic824; cptr1 = cptr + swide * bperpix; @@ -369,26 +369,10 @@ lastline = linecnt = 0; - for (i=0, clptr=pic824; i<=shigh; i++, clptr+=swide*bperpix) { + for (i=0, clptr=pic824; i