Browse Source

Fix possible endless loop when decoding amr.

Fixes bug 151.

Reviewed-by: Vitor Sessak
tags/n0.10
Carl Eugen Hoyos 14 years ago
parent
commit
290e7eb77b
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/acelp_vectors.c

+ 2
- 0
libavcodec/acelp_vectors.c View File

@@ -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;


Loading…
Cancel
Save