Commit 7f09791d authored by Oana Stratulat's avatar Oana Stratulat Committed by Ronald S. Bultje

Report an error if pitch_lag is zero in AMR-NB decoder.

This fixes an infinite loop in the decoder on specially
crafted files, and fixes bug 151.
Signed-off-by: 's avatarRonald S. Bultje <rsbultje@gmail.com>
parent 3fa646e8
......@@ -977,6 +977,10 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data,
pitch_sharpening(p, subframe, p->cur_frame_mode, &fixed_sparse);
if (fixed_sparse.pitch_lag == 0) {
av_log(avctx, AV_LOG_ERROR, "The file is corrupted, pitch_lag = 0 is not allowed\n");
return AVERROR_INVALIDDATA;
}
ff_set_fixed_vector(p->fixed_vector, &fixed_sparse, 1.0,
AMR_SUBFRAME_SIZE);
......
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