[asterisk-commits] rmudgett: branch 1.8 r373640 - /branches/1.8/codecs/ilbc/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Sep 25 12:18:42 CDT 2012


Author: rmudgett
Date: Tue Sep 25 12:18:38 2012
New Revision: 373640

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=373640
Log:
Fix valgrind found memcpy issues in codec_ilbc.

Valgrind found codec_ilbc using memcpy instead of memmove for overlapping
memory blocks.

(issue ASTERISK-19890)
(closes issue ASTERISK-20231)
Reported by: Walter Doekes
Patches:
      ASTERISK-20231.patch (license #5674) patch uploaded by Walter Doekes

Modified:
    branches/1.8/codecs/ilbc/iLBC_decode.c
    branches/1.8/codecs/ilbc/iLBC_encode.c

Modified: branches/1.8/codecs/ilbc/iLBC_decode.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/codecs/ilbc/iLBC_decode.c?view=diff&rev=373640&r1=373639&r2=373640
==============================================================================
--- branches/1.8/codecs/ilbc/iLBC_decode.c (original)
+++ branches/1.8/codecs/ilbc/iLBC_decode.c Tue Sep 25 12:18:38 2012
@@ -251,7 +251,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,
 
 
@@ -299,7 +299,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));

Modified: branches/1.8/codecs/ilbc/iLBC_encode.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/codecs/ilbc/iLBC_encode.c?view=diff&rev=373640&r1=373639&r2=373640
==============================================================================
--- branches/1.8/codecs/ilbc/iLBC_encode.c (original)
+++ branches/1.8/codecs/ilbc/iLBC_encode.c Tue Sep 25 12:18:38 2012
@@ -308,7 +308,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,
 
 
@@ -386,7 +386,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 asterisk-commits mailing list