aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-11-09 13:26:20 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-07 01:00:02 +0100
commit2502914c5f8eb77659d7c0868396862557a63245 (patch)
treea848411442ad70b4af42d5390968ff99cbb4732a
parent6df0d3e2916c223dbe4262bf1b876dff1cb3f980 (diff)
downloadffmpeg-2502914c5f8eb77659d7c0868396862557a63245.tar.gz
atrac3dec: Check coding mode against channels.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 13451f5520ce6b0afde861b2285dda659f8d4fb4) Conflicts: libavcodec/atrac3.c
-rw-r--r--libavcodec/atrac3.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index 7d076bed99..1da4c786eb 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -955,6 +955,11 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
}
/* Check the extradata. */
+ if (q->codingMode == JOINT_STEREO && avctx->channels < 2) {
+ av_log(avctx, AV_LOG_ERROR, "Invalid coding mode\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if (q->atrac3version != 4) {
av_log(avctx,AV_LOG_ERROR,"Version %d != 4.\n",q->atrac3version);
return AVERROR_INVALIDDATA;