changeset 3641:33c560ffd3dc

minor bugfixes (noone noticed them) a few more asserts
author michael
date Fri, 21 Dec 2001 02:09:34 +0000
parents 97b8c679b6a3
children 2cef9d562af0
files postproc/swscale.c postproc/swscale_template.c
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/postproc/swscale.c	Fri Dec 21 02:05:57 2001 +0000
+++ b/postproc/swscale.c	Fri Dec 21 02:09:34 2001 +0000
@@ -206,7 +206,7 @@
 			int u=0;
 			int v=0;
 			int j;
-			for(j=0; j<lumFilterSize; j++)
+			for(j=0; j<chrFilterSize; j++)
 			{
 				u += chrSrc[j][i] * chrFilter[j];
 				v += chrSrc[j][i + 2048] * chrFilter[j];
--- a/postproc/swscale_template.c	Fri Dec 21 02:05:57 2001 +0000
+++ b/postproc/swscale_template.c	Fri Dec 21 02:09:34 2001 +0000
@@ -1558,8 +1558,8 @@
 			"addl $4, %0			\n\t"
 			" jnc 1b			\n\t"
 
-			: "+r" (counter)
-			: "r" (filter), "m" (filterPos), "m" (dst), "m"(src+filterSize),
+			: "+r" (counter), "+r" (filter)
+			: "m" (filterPos), "m" (dst), "m"(src+filterSize),
 			  "m" (src), "r" (filterSize*2)
 			: "%ebx", "%eax", "%ecx"
 		);
@@ -2339,12 +2339,14 @@
 		for(i=0; i<vLumBufSize; i++) memset(lumPixBuf[i], 0, 4000);
 		for(i=0; i<vChrBufSize; i++) memset(chrPixBuf[i], 64, 8000);
 
+		ASSERT(chrDstH<=dstH)
+		ASSERT(vLumFilterSize*dstH*4<16000)
+		ASSERT(vChrFilterSize*chrDstH*4<16000)
 #ifdef HAVE_MMX
 		// pack filter data for mmx code
 		for(i=0; i<vLumFilterSize*dstH; i++)
 			lumMmxFilter[4*i]=lumMmxFilter[4*i+1]=lumMmxFilter[4*i+2]=lumMmxFilter[4*i+3]=
 				vLumFilter[i];
-
 		for(i=0; i<vChrFilterSize*chrDstH; i++)
 			chrMmxFilter[4*i]=chrMmxFilter[4*i+1]=chrMmxFilter[4*i+2]=chrMmxFilter[4*i+3]=
 				vChrFilter[i];
@@ -2598,4 +2600,4 @@
 	__asm __volatile(EMMS:::"memory");
 #endif
 	firstTime=0;
-}
\ No newline at end of file
+}