[MPlayer-dev-eng] [PATCH] libvo/aclib_template.c small_memcpy wrong??

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Dec 4 23:11:31 CET 2005


Hi,
here is an untested patch for $SUBJECT, which I think is broken. What is
that dummy variable supposed to be? It is never initialized. Also
without cld the copy might go off in the wrong direction and cause a
segfault.

Greetings,
Reimar Döffinger
-------------- next part --------------
Index: libvo/aclib_template.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/aclib_template.c,v
retrieving revision 1.12
diff -u -r1.12 aclib_template.c
--- libvo/aclib_template.c	4 Jun 2005 21:11:39 -0000	1.12
+++ libvo/aclib_template.c	4 Dec 2005 22:00:00 -0000
@@ -83,10 +83,10 @@
 /* for small memory blocks (<256 bytes) this version is faster */
 #define small_memcpy(to,from,n)\
 {\
-register unsigned long int dummy;\
 __asm__ __volatile__(\
+	"cld\n\t"\
 	"rep; movsb"\
-	:"=&D"(to), "=&S"(from), "=&c"(dummy)\
+	:"=&D"(to), "=&S"(from), "=&c"(n)\
 /* It's most portable way to notify compiler */\
 /* that edi, esi and ecx are clobbered in asm block. */\
 /* Thanks to A'rpi for hint!!! */\


More information about the MPlayer-dev-eng mailing list