[FFmpeg-cvslog] Report an error if pitch_lag is zero in AMR-NB decoder.
Oana Stratulat
git at videolan.org
Fri Jan 6 02:53:06 CET 2012
ffmpeg | branch: master | Oana Stratulat <oanaandreeastratulat at gmail.com> | Thu Jan 5 01:08:05 2012 +0200| [7f09791d28c82c9169d1612a6192851837341ca9] | committer: 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: Ronald S. Bultje <rsbultje at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f09791d28c82c9169d1612a6192851837341ca9
---
libavcodec/amrnbdec.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c
index 926014f..fff0e72 100644
--- a/libavcodec/amrnbdec.c
+++ b/libavcodec/amrnbdec.c
@@ -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);
More information about the ffmpeg-cvslog
mailing list