diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-09 16:26:20 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-09 16:26:20 +0400 |
commit | 13451f5520ce6b0afde861b2285dda659f8d4fb4 (patch) | |
tree | a051881dbde29a4caa191a392ff11e89962a779e /libavcodec/atrac3.c | |
parent | 5ee008e01d5a50d976b5f2a4abd6932185672d91 (diff) |
atrac3dec: Check coding mode against channels.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/atrac3.c')
-rw-r--r-- | libavcodec/atrac3.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index abc2927840..101a8873a3 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -916,6 +916,11 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx) return AVERROR(EINVAL); } + if (q->coding_mode == JOINT_STEREO && avctx->channels < 2) { + av_log(avctx, AV_LOG_ERROR, "Invalid coding mode\n"); + return AVERROR_INVALIDDATA; + } + /* Check the extradata */ if (version != 4) { |