aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
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-09-13 15:47:43 +0200
commit40ee4de6a6a9f7af3b5bb8a690aa1cae0a752430 (patch)
treeab4ea613b0c2e7fa7c99422719ad3a85c5bb9b97 /libavcodec
parente06623c48030530b50f00cee26f1a3a33c4b4d4b (diff)
downloadffmpeg-40ee4de6a6a9f7af3b5bb8a690aa1cae0a752430.tar.gz
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 (cherry picked from commit 50cf5a7fb78846fc39b3ecdaa896a10bcd74da2a) Signed-off-by: Luca Barbato <lu_zero@gentoo.org> Conflicts: libavcodec/atrac3.c
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/atrac3.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index cc0cc7c099..e31dd1dcd5 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -976,6 +976,8 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
if (q->codingMode == STEREO) {
av_log(avctx,AV_LOG_DEBUG,"Normal stereo detected.\n");
} else if (q->codingMode == JOINT_STEREO) {
+ if (avctx->channels != 2)
+ return AVERROR_INVALIDDATA;
av_log(avctx,AV_LOG_DEBUG,"Joint stereo detected.\n");
} else {
av_log(avctx,AV_LOG_ERROR,"Unknown channel coding mode %x!\n",q->codingMode);