diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2012-08-02 07:54:16 +0200 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2012-08-03 07:07:07 +0200 |
commit | 802bcdcb2f177b84cdf8e0197338a808fc26fbff (patch) | |
tree | c51ee373323dc25fdd3851fd5e6ddb85418e50ec /libavcodec/g723_1.c | |
parent | 8ddadea171fa38563cc1ff9a78d4cd07655c0e1b (diff) | |
download | ffmpeg-802bcdcb2f177b84cdf8e0197338a808fc26fbff.tar.gz |
g723_1: fix upper bound parameter from inverse maximum autocorrelation
Diffstat (limited to 'libavcodec/g723_1.c')
-rw-r--r-- | libavcodec/g723_1.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c index 4ad74f4448..883c9498a4 100644 --- a/libavcodec/g723_1.c +++ b/libavcodec/g723_1.c @@ -630,7 +630,10 @@ static int autocorr_max(G723_1_Context *p, int offset, int *ccr_max, int i; pitch_lag = FFMIN(PITCH_MAX - 3, pitch_lag); - limit = FFMIN(FRAME_LEN + PITCH_MAX - offset - length, pitch_lag + 3); + if (dir > 0) + limit = FFMIN(FRAME_LEN + PITCH_MAX - offset - length, pitch_lag + 3); + else + limit = pitch_lag + 3; for (i = pitch_lag - 3; i <= limit; i++) { ccr = dot_product(buf, buf + dir * i, length, 1); |