[FFmpeg-cvslog] truespeech: use sizeof() instead of hardcoded sizes

Justin Ruggles git at videolan.org
Fri Oct 14 03:58:31 CEST 2011


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Thu Oct 13 14:03:17 2011 -0400| [c6ac30c84b1d6a21af49b72f13ba2248e6b2844d] | committer: Justin Ruggles

truespeech: use sizeof() instead of hardcoded sizes

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c6ac30c84b1d6a21af49b72f13ba2248e6b2844d
---

 libavcodec/truespeech.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c
index 72d828a..7747fca 100644
--- a/libavcodec/truespeech.c
+++ b/libavcodec/truespeech.c
@@ -127,7 +127,7 @@ static void truespeech_correlate_filter(TSContext *dec)
 
     for(i = 0; i < 8; i++){
         if(i > 0){
-            memcpy(tmp, dec->cvector, i * 2);
+            memcpy(tmp, dec->cvector, i * sizeof(*tmp));
             for(j = 0; j < i; j++)
                 dec->cvector[j] = ((tmp[i - j - 1] * dec->vector[i]) +
                                    (dec->cvector[j] << 15) + 0x4000) >> 15;
@@ -169,7 +169,7 @@ static void truespeech_apply_twopoint_filter(TSContext *dec, int quart)
 
     t = dec->offset2[quart];
     if(t == 127){
-        memset(dec->newvec, 0, 60 * 2);
+        memset(dec->newvec, 0, 60 * sizeof(*dec->newvec));
         return;
     }
     for(i = 0; i < 146; i++)
@@ -194,7 +194,7 @@ static void truespeech_place_pulses(TSContext *dec, int16_t *out, int quart)
     int16_t *ptr2;
     int coef;
 
-    memset(out, 0, 60 * 2);
+    memset(out, 0, 60 * sizeof(*out));
     for(i = 0; i < 7; i++) {
         t = dec->pulseval[quart] & 3;
         dec->pulseval[quart] >>= 2;



More information about the ffmpeg-cvslog mailing list