[MPlayer-cvslog] r22410 - trunk/libswscale/swscale.c

michael subversion at mplayerhq.hu
Fri Mar 2 14:32:10 CET 2007


Author: michael
Date: Fri Mar  2 14:32:10 2007
New Revision: 22410

Modified:
   trunk/libswscale/swscale.c

Log:
copy src to prevent the user supplied argumet from being changed


Modified: trunk/libswscale/swscale.c
==============================================================================
--- trunk/libswscale/swscale.c	(original)
+++ trunk/libswscale/swscale.c	Fri Mar  2 14:32:10 2007
@@ -2435,10 +2435,11 @@ int sws_scale(SwsContext *c, uint8_t* sr
 
 	// copy strides, so they can safely be modified
 	if (c->sliceDir == 1) {
+            uint8_t* src2[4]= {src[0], src[1], src[2]};
 	    // slices go from top to bottom
 	    int srcStride2[3]= {srcStride[0], srcStride[1], srcStride[2]};
 	    int dstStride2[3]= {dstStride[0], dstStride[1], dstStride[2]};
-	    return c->swScale(c, src, srcStride2, srcSliceY, srcSliceH, dst, dstStride2);
+	    return c->swScale(c, src2, srcStride2, srcSliceY, srcSliceH, dst, dstStride2);
 	} else {
 	    // slices go from bottom to top => we flip the image internally
 	    uint8_t* src2[3]= {src[0] + (srcSliceH-1)*srcStride[0],



More information about the MPlayer-cvslog mailing list