[FFmpeg-cvslog] Fix possible endless loop when decoding amr.

Carl Eugen Hoyos git at videolan.org
Sun Dec 18 15:31:10 CET 2011


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sun Dec 18 14:20:14 2011 +0100| [290e7eb77bee5a54182fb3d5fb122c1e117190da] | committer: Carl Eugen Hoyos

Fix possible endless loop when decoding amr.

Fixes bug 151.

Reviewed-by: Vitor Sessak

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

 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 a44ab8c..e6db556 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;



More information about the ffmpeg-cvslog mailing list