changeset 32976:baf42f6f5518

Use memmove when source and destination can overlap.
author ranma
date Wed, 09 Mar 2011 21:18:25 +0000
parents 0dc9d64cd64e
children 541ec87f49ee
files mencoder.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mencoder.c	Wed Mar 09 15:36:10 2011 +0000
+++ b/mencoder.c	Wed Mar 09 21:18:25 2011 +0000
@@ -300,7 +300,7 @@
 		fast_memcpy(buffer+size,sh_audio->a_out_buffer,len);
 		sh_audio->a_out_buffer_len-=len; size+=len;
 		if(sh_audio->a_out_buffer_len>0)
-		    fast_memcpy(sh_audio->a_out_buffer,&sh_audio->a_out_buffer[len],sh_audio->a_out_buffer_len);
+		    memmove(sh_audio->a_out_buffer,&sh_audio->a_out_buffer[len],sh_audio->a_out_buffer_len);
     }
     return size;
 }
@@ -1382,7 +1382,7 @@
 	    mux_a->wf->nAvgBytesPerSec=0.5f+(double)mux_a->size/a_muxer_time; // avg bps (VBR)
 	if(mux_a->buffer_len>=len){
 	    mux_a->buffer_len-=len;
-	    fast_memcpy(mux_a->buffer,mux_a->buffer+len,mux_a->buffer_len);
+	    memmove(mux_a->buffer,mux_a->buffer+len,mux_a->buffer_len);
 	}