mp3on4: fix null pointer dereference
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 14 Dec 2012 20:50:23 +0000 (21:50 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 14 Dec 2012 20:50:43 +0000 (21:50 +0100)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mpegaudiodec.c

index 8f748f4..e4073ee 100644 (file)
@@ -1965,7 +1965,7 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data,
 
         avpriv_mpegaudio_decode_header((MPADecodeHeader *)m, header);
 
-        if (ch + m->nb_channels > avctx->channels) {
+        if (ch + m->nb_channels > avctx->channels || s->coff[fr] + m->nb_channels > avctx->channels) {
             av_log(avctx, AV_LOG_ERROR, "frame channel count exceeds codec "
                                         "channel count\n");
             return AVERROR_INVALIDDATA;