Commit a974adc3 authored by Michael Niedermayer's avatar Michael Niedermayer

g729dec: check pitch_delay_int.

Fix out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 56d09250
......@@ -510,6 +510,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr,
/* Round pitch delay to nearest (used everywhere except ff_acelp_interpolate). */
pitch_delay_int[i] = (pitch_delay_3x + 1) / 3;
if (pitch_delay_int[i] > PITCH_DELAY_MAX) {
av_log(avctx, AV_LOG_WARNING, "pitch_delay_int %d is too large\n", pitch_delay_int[i]);
pitch_delay_int[i] = PITCH_DELAY_MAX;
}
if (frame_erasure) {
ctx->rand_value = g729_prng(ctx->rand_value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment