diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2009-03-01 11:14:21 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2009-03-01 11:14:21 +0000 |
commit | 9e27e0d4f825e97104333e3006f450f566935af0 (patch) | |
tree | 29d7a8e564c5a2c1af22f14049b4e33d8885b326 /libavcodec | |
parent | d819b41ba18efdf468bfc7dc52928b534576ce13 (diff) | |
download | ffmpeg-9e27e0d4f825e97104333e3006f450f566935af0.tar.gz |
Do not read uninitialized buffer, no matter if it will be multiplied by
zero later. This should fix some valgrind warnings and hopefully FATE
ra144 test on ARM.
Originally committed as revision 17677 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/ra144.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c index 01cbc86f3e..5661bdc6f6 100644 --- a/libavcodec/ra144.c +++ b/libavcodec/ra144.c @@ -138,8 +138,13 @@ static void add_wav(int16_t *dest, int n, int skip_first, int *m, for (i=!skip_first; i<3; i++) v[i] = (gain_val_tab[n][i] * m[i]) >> gain_exp_tab[n]; + if (v[0]) { for (i=0; i < BLOCKSIZE; i++) dest[i] = (s1[i]*v[0] + s2[i]*v[1] + s3[i]*v[2]) >> 12; + } else { + for (i=0; i < BLOCKSIZE; i++) + dest[i] = (s2[i]*v[1] + s3[i]*v[2]) >> 12; + } } static unsigned int rescale_rms(unsigned int rms, unsigned int energy) |