You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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
This commit is contained in:
@@ -941,9 +941,11 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
if (q->coding_mode == STEREO)
|
if (q->coding_mode == STEREO)
|
||||||
av_log(avctx, AV_LOG_DEBUG, "Normal stereo detected.\n");
|
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");
|
av_log(avctx, AV_LOG_DEBUG, "Joint stereo detected.\n");
|
||||||
else {
|
} else {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Unknown channel coding mode %x!\n",
|
av_log(avctx, AV_LOG_ERROR, "Unknown channel coding mode %x!\n",
|
||||||
q->coding_mode);
|
q->coding_mode);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
Reference in New Issue
Block a user