Commit a3d9a216 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'bbf6a4aa'

* commit 'bbf6a4aa':
  imc: Catch a division by zero
  atrac3: Error on impossible encoding/channel combinations

See: 13451f55Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 40e8967e bbf6a4aa
......@@ -923,11 +923,6 @@ 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) {
......@@ -950,9 +945,13 @@ 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) {
av_log(avctx, AV_LOG_ERROR, "Invalid coding mode\n");
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment