aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2011-12-18 14:20:14 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-03 19:10:33 +0100
commitbf58e5422de237afba5d7a226a25f2473e585cbf (patch)
treefecd736eda63a286faa4a18986870548b830fd06
parent88eaab28278894a4885e81da877f9b92e15c2ddd (diff)
downloadffmpeg-bf58e5422de237afba5d7a226a25f2473e585cbf.tar.gz
Fix possible endless loop when decoding amr.
Fixes bug 151. Reviewed-by: Vitor Sessak (cherry picked from commit 290e7eb77bee5a54182fb3d5fb122c1e117190da) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/acelp_vectors.c2
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;