[MPlayer-cvslog] r26038 - trunk/libmpcodecs/vf_sab.c

diego subversion at mplayerhq.hu
Wed Feb 20 09:24:27 CET 2008


Author: diego
Date: Wed Feb 20 09:24:26 2008
New Revision: 26038

Log:
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


Modified:
   trunk/libmpcodecs/vf_sab.c

Modified: trunk/libmpcodecs/vf_sab.c
==============================================================================
--- trunk/libmpcodecs/vf_sab.c	(original)
+++ trunk/libmpcodecs/vf_sab.c	Wed Feb 20 09:24:26 2008
@@ -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];



More information about the MPlayer-cvslog mailing list