[Asterisk-cvs] asterisk/codecs/ilbc iLBC_decode.c, 1.4, 1.5 iLBC_encode.c, 1.4, 1.5

kpfleming kpfleming
Mon Aug 22 21:50:34 CDT 2005


Update of /usr/cvsroot/asterisk/codecs/ilbc
In directory mongoose.digium.com:/tmp/cvs-serv11263/codecs/ilbc

Modified Files:
	iLBC_decode.c iLBC_encode.c 
Log Message:
use memmove() when memory regions might overlap (issue #4957)


Index: iLBC_decode.c
===================================================================
RCS file: /usr/cvsroot/asterisk/codecs/ilbc/iLBC_decode.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- iLBC_decode.c	14 Oct 2004 05:45:34 -0000	1.4
+++ iLBC_decode.c	23 Aug 2005 01:52:38 -0000	1.5
@@ -241,7 +241,7 @@
 
             /* update memory */
 
-            memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
+            memmove(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
             memcpy(mem+CB_MEML-SUBL, 
                 &decresidual[(start+1+subframe)*SUBL],
                 SUBL*sizeof(float));
@@ -286,7 +286,7 @@
 
             /* update memory */
 
-            memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
+            memmove(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
             memcpy(mem+CB_MEML-SUBL, 
                 &reverseDecresidual[subframe*SUBL],
                 SUBL*sizeof(float));

Index: iLBC_encode.c
===================================================================
RCS file: /usr/cvsroot/asterisk/codecs/ilbc/iLBC_encode.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- iLBC_encode.c	14 Oct 2004 05:45:34 -0000	1.4
+++ iLBC_encode.c	23 Aug 2005 01:52:38 -0000	1.5
@@ -294,7 +294,7 @@
 
             /* update memory */
 
-            memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
+            memmove(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
             memcpy(mem+CB_MEML-SUBL, 
                 &decresidual[(start+1+subframe)*SUBL], 
                 SUBL*sizeof(float));
@@ -364,7 +364,7 @@
 
             /* update memory */
 
-            memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
+            memmove(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
             memcpy(mem+CB_MEML-SUBL, 
                 &reverseDecresidual[subframe*SUBL],
                 SUBL*sizeof(float));




More information about the svn-commits mailing list