summaryrefslogtreecommitdiff
path: root/libavcodec/atrac3.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-09 13:26:20 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-11-09 13:26:20 +0100
commit13451f5520ce6b0afde861b2285dda659f8d4fb4 (patch)
treea051881dbde29a4caa191a392ff11e89962a779e /libavcodec/atrac3.c
parent5ee008e01d5a50d976b5f2a4abd6932185672d91 (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.c5
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) {