From f418b86151921355e6843a126154d56ce86256ae Mon Sep 17 00:00:00 2001 From: Jai Menon Date: Tue, 10 Feb 2009 13:47:50 +0000 Subject: [PATCH] Check sampling index validity for AAC decoding Patch by Jai Menon ( jmenon86 gmail com ) Originally committed as revision 17131 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/aac.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/aac.c b/libavcodec/aac.c index 87b58bcc4f..7275430a8d 100644 --- a/libavcodec/aac.c +++ b/libavcodec/aac.c @@ -1555,6 +1555,10 @@ static int aac_decode_frame(AVCodecContext * avccontext, void * data, int * data av_log(avccontext, AV_LOG_ERROR, "Error decoding AAC frame header.\n"); return -1; } + if (ac->m4ac.sampling_index > 11) { + av_log(ac->avccontext, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->m4ac.sampling_index); + return -1; + } } // parse