[MPlayer-cvslog] CVS: main/postproc swscale.c,1.155,1.156

Jindrich Makovicka CVS syncmail at mplayerhq.hu
Sun Apr 24 09:50:20 CEST 2005


CVS change done by Jindrich Makovicka CVS

Update of /cvsroot/mplayer/main/postproc
In directory mail:/var2/tmp/cvs-serv27747

Modified Files:
	swscale.c 
Log Message:
check for negative strides before memcpy

Index: swscale.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/swscale.c,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -r1.155 -r1.156
--- swscale.c	24 Apr 2005 07:47:41 -0000	1.155
+++ swscale.c	24 Apr 2005 07:50:18 -0000	1.156
@@ -1425,7 +1425,7 @@
              int srcSliceH, uint8_t* dstParam[], int dstStride[]){
 	uint8_t *dst=dstParam[0] + dstStride[0]*srcSliceY;
 	/* Copy Y plane */
-	if(dstStride[0]==srcStride[0])
+	if(dstStride[0]==srcStride[0] && srcStride[0] > 0)
 		memcpy(dst, src[0], srcSliceH*dstStride[0]);
 	else
 	{
@@ -1559,7 +1559,7 @@
 	int i;
 
 	/* copy Y */
-	if(srcStride[0]==dstStride[0]) 
+	if(srcStride[0]==dstStride[0] && srcStride[0] > 0) 
 		memcpy(dst[0]+ srcSliceY*dstStride[0], src[0], srcStride[0]*srcSliceH);
 	else{
 		uint8_t *srcPtr= src[0];
@@ -1633,7 +1633,7 @@
 
 	if(isPacked(c->srcFormat))
 	{
-		if(dstStride[0]==srcStride[0])
+		if(dstStride[0]==srcStride[0] && srcStride[0] > 0)
 			memcpy(dst[0] + dstStride[0]*srcSliceY, src[0], srcSliceH*dstStride[0]);
 		else
 		{
@@ -1671,7 +1671,7 @@
 			}
 			else
 			{
-				if(dstStride[plane]==srcStride[plane])
+				if(dstStride[plane]==srcStride[plane] && srcStride[plane] > 0)
 					memcpy(dst[plane] + dstStride[plane]*y, src[plane], height*dstStride[plane]);
 				else
 				{




More information about the MPlayer-cvslog mailing list