changeset 15069:3f5daa60e049

support for negative strides (fixes -vf spp,flip crash)
author henry
date Fri, 08 Apr 2005 10:31:18 +0000
parents 1cb1a9584c3b
children bde4030f9134
files libvo/fastmemcpy.h
diffstat 1 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/fastmemcpy.h	Fri Apr 08 06:15:04 2005 +0000
+++ b/libvo/fastmemcpy.h	Fri Apr 08 10:31:18 2005 +0000
@@ -25,7 +25,16 @@
 	int i;
 	void *retval=dst;
 
-	if(dstStride == srcStride) mem2agpcpy(dst, src, srcStride*height);
+	if(dstStride == srcStride)
+	{
+		if (srcStride < 0) {
+	    		src += (height-1)*srcStride;
+	    		dst += (height-1)*dstStride;
+	    		srcStride = -srcStride;
+		}
+
+		mem2agpcpy(dst, src, srcStride*height);
+	}
 	else
 	{
 		for(i=0; i<height; i++)
@@ -44,7 +53,16 @@
 	int i;
 	void *retval=dst;
 
-	if(dstStride == srcStride) memcpy(dst, src, srcStride*height);
+	if(dstStride == srcStride)
+	{
+		if (srcStride < 0) {
+	    		src += (height-1)*srcStride;
+	    		dst += (height-1)*dstStride;
+	    		srcStride = -srcStride;
+		}
+
+		memcpy(dst, src, srcStride*height);
+	}
 	else
 	{
 		for(i=0; i<height; i++)