diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2011-12-18 17:20:14 +0400 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2011-12-18 17:20:14 +0400 |
commit | 290e7eb77bee5a54182fb3d5fb122c1e117190da (patch) | |
tree | b12e031f37b7d612bb959030b0243b8c42739f3a /libavcodec | |
parent | b6b00675112b411fbb10e8b01be1d3ddc2574cf9 (diff) |
Fix possible endless loop when decoding amr.
Fixes bug 151.
Reviewed-by: Vitor Sessak
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/acelp_vectors.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/acelp_vectors.c b/libavcodec/acelp_vectors.c index a44ab8cfe6..e6db556410 100644 --- a/libavcodec/acelp_vectors.c +++ b/libavcodec/acelp_vectors.c @@ -237,6 +237,7 @@ void ff_set_fixed_vector(float *out, const AMRFixed *in, float scale, int size) int x = in->x[i], repeats = !((in->no_repeat_mask >> i) & 1); float y = in->y[i] * scale; + if (in->pitch_lag > 0) do { out[x] += y; y *= in->pitch_fac; @@ -252,6 +253,7 @@ void ff_clear_fixed_vector(float *out, const AMRFixed *in, int size) for (i=0; i < in->n; i++) { int x = in->x[i], repeats = !((in->no_repeat_mask >> i) & 1); + if (in->pitch_lag > 0) do { out[x] = 0.0; x += in->pitch_lag; |