summaryrefslogtreecommitdiff
path: root/libavcodec/atrac3.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-07-09 04:44:26 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-07-09 10:49:29 +0200
commit50cf5a7fb78846fc39b3ecdaa896a10bcd74da2a (patch)
tree79c0bde3d847dbb1fc4bde0f7aa2e83e0a12ee01 /libavcodec/atrac3.c
parent22e76ec635bafdd1d1ec35581a7ac09e69e3c43e (diff)
atrac3: Error on impossible encoding/channel combinations
Joint stereo encoded mono is impossible. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/atrac3.c')
-rw-r--r--libavcodec/atrac3.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index cd120e9f6a..6a8fae72d8 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -941,9 +941,11 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
if (q->coding_mode == STEREO)
av_log(avctx, AV_LOG_DEBUG, "Normal stereo detected.\n");
- else if (q->coding_mode == JOINT_STEREO)
+ else if (q->coding_mode == JOINT_STEREO) {
+ if (avctx->channels != 2)
+ return AVERROR_INVALIDDATA;
av_log(avctx, AV_LOG_DEBUG, "Joint stereo detected.\n");
- else {
+ } else {
av_log(avctx, AV_LOG_ERROR, "Unknown channel coding mode %x!\n",
q->coding_mode);
return AVERROR_INVALIDDATA;