aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpcodecs
diff options
context:
space:
mode:
authorGravatar diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-02-20 08:24:26 +0000
committerGravatar diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-02-20 08:24:26 +0000
commit9ae4923673f76d9673d662b32c33134123ff335d (patch)
tree2cfc998f3c7e1234177f73234ba07ce50c84a06c /libmpcodecs
parentb4558a37389563975bf980bdf7993365af4b1a1a (diff)
vf_sab mirrors coefficients past the edge of the picture instead of cropping:
if (iy<0) iy= -iy; if(iy>=h) iy= h-iy-1; This produces -1,-2,-3... as it goes further past the end of an image, which crashes. Change this to h-1,h-2,h-3.. to avoid the crash. patch by Alexander Strange, astrange ithinksw com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26038 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vf_sab.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libmpcodecs/vf_sab.c b/libmpcodecs/vf_sab.c
index 5ac3ffa827..f9e624a1d0 100644
--- a/libmpcodecs/vf_sab.c
+++ b/libmpcodecs/vf_sab.c
@@ -203,7 +203,7 @@ if((x/32)&1){
int dx;
int iy= y+dy - radius;
if (iy<0) iy= -iy;
- else if(iy>=h) iy= h-iy-1;
+ else if(iy>=h) iy= h+h-iy-1;
for(dx=0; dx<radius*2+1; dx++){
const int ix= x+dx - radius;
@@ -220,13 +220,13 @@ if((x/32)&1){
int dx;
int iy= y+dy - radius;
if (iy<0) iy= -iy;
- else if(iy>=h) iy= h-iy-1;
+ else if(iy>=h) iy= h+h-iy-1;
for(dx=0; dx<radius*2+1; dx++){
int ix= x+dx - radius;
int factor;
if (ix<0) ix= -ix;
- else if(ix>=w) ix= w-ix-1;
+ else if(ix>=w) ix= w+w-ix-1;
factor= f.colorDiffCoeff[256+preVal - f.preFilterBuf[ix + iy*f.preFilterStride] ]
*f.distCoeff[dx + dy*f.distStride];