diff options
author | Martin Storsjö <martin@martin.st> | 2013-09-19 15:32:02 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-09-19 22:44:18 +0300 |
commit | e9d61de96c113ee0ef8082833c7e682df0e23eec (patch) | |
tree | d1871de4e6354d3837ca69104a065150035f24d0 /libavcodec | |
parent | f50803354c6acb4575379d7c54ca48ec5d36dd61 (diff) | |
download | ffmpeg-e9d61de96c113ee0ef8082833c7e682df0e23eec.tar.gz |
mpegaudiodec: Validate that the number of channels fits at the given offset
This is similar to the fix in 35cbc98b.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpegaudiodec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index c18f433b4b..423b4b06a1 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -1939,7 +1939,8 @@ 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; |