[FFmpeg-cvslog] atrac3dec: Check coding mode against channels.

Michael Niedermayer git at videolan.org
Fri Nov 9 13:30:57 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Nov  9 13:26:20 2012 +0100| [13451f5520ce6b0afde861b2285dda659f8d4fb4] | committer: Michael Niedermayer

atrac3dec: Check coding mode against channels.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=13451f5520ce6b0afde861b2285dda659f8d4fb4
---

 libavcodec/atrac3.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index abc2927..101a887 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -916,6 +916,11 @@ 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) {



More information about the ffmpeg-cvslog mailing list