use memmove() when memory regions might overlap (issue #4957)
authorKevin P. Fleming <kpfleming@digium.com>
Tue, 23 Aug 2005 01:52:38 +0000 (01:52 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Tue, 23 Aug 2005 01:52:38 +0000 (01:52 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6372 65c4cc65-6c06-0410-ace0-fbb531ad65f3

codecs/ilbc/iLBC_decode.c
codecs/ilbc/iLBC_encode.c

index 91c80c8..22bfff7 100755 (executable)
@@ -241,7 +241,7 @@ static void Decode(
 
             /* 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 @@ static void Decode(
 
             /* 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 e209062..bd14964 100755 (executable)
@@ -294,7 +294,7 @@ void iLBC_encode(
 
             /* 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 @@ void iLBC_encode(
 
             /* 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));