[MPlayer-dev-eng] [PATCH] fixing the fix for vCCoeffsBank

Alan Curry pacman at TheWorld.com
Thu Feb 16 06:57:26 CET 2006


When the initialization of vCCoeffsBank was moved into sws_getContext(),
there should have been an adjustment in the way its size is computed, from
dstH to chrDstH. It turns out that in all cases where vCCoeffsBank is
actually used, dstH==chrDstH, so the behavior is correct. But in cases where
it is not used (like when converting from RGB to YUV), the initialization
loop with dstH can cause a segfault.

(Creating these "banks" in cases where they will not be used might also be
considered a bug, but not as simple to fix as just using the correct size)
-------------- next part --------------
Index: swscale.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/swscale.c,v
retrieving revision 1.165
diff -u -r1.165 swscale.c
--- swscale.c	11 Feb 2006 14:16:10 -0000	1.165
+++ swscale.c	16 Feb 2006 04:19:03 -0000
@@ -2113,7 +2113,7 @@
 
 #ifdef HAVE_ALTIVEC
 		c->vYCoeffsBank = memalign (16, sizeof (vector signed short)*c->vLumFilterSize*c->dstH);
-		c->vCCoeffsBank = memalign (16, sizeof (vector signed short)*c->vChrFilterSize*c->dstH);
+		c->vCCoeffsBank = memalign (16, sizeof (vector signed short)*c->vChrFilterSize*c->chrDstH);
 
 		for (i=0;i<c->vLumFilterSize*c->dstH;i++) {
                   int j;
@@ -2122,7 +2122,7 @@
 		    p[j] = c->vLumFilter[i];
 		}
 
-		for (i=0;i<c->vChrFilterSize*c->dstH;i++) {
+		for (i=0;i<c->vChrFilterSize*c->chrDstH;i++) {
                   int j;
 		  short *p = (short *)&c->vCCoeffsBank[i];
 		  for (j=0;j<8;j++)


More information about the MPlayer-dev-eng mailing list