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 50cf5a7fb7
)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Conflicts:
libavcodec/atrac3.c
This commit is contained in:

committed by
Michael Niedermayer

parent
cb198f945f
commit
93c524c0f0
@@ -976,6 +976,8 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
|
|||||||
if (q->codingMode == STEREO) {
|
if (q->codingMode == STEREO) {
|
||||||
av_log(avctx,AV_LOG_DEBUG,"Normal stereo detected.\n");
|
av_log(avctx,AV_LOG_DEBUG,"Normal stereo detected.\n");
|
||||||
} else if (q->codingMode == JOINT_STEREO) {
|
} else if (q->codingMode == JOINT_STEREO) {
|
||||||
|
if (avctx->channels != 2)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
av_log(avctx,AV_LOG_DEBUG,"Joint stereo detected.\n");
|
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->codingMode);
|
av_log(avctx,AV_LOG_ERROR,"Unknown channel coding mode %x!\n",q->codingMode);
|
||||||
|
Reference in New Issue
Block a user