[FFmpeg-cvslog] atrac3: Error on impossible encoding/channel combinations

Luca Barbato git at videolan.org
Sun Sep 22 13:28:52 CEST 2013


ffmpeg | branch: release/0.10 | Luca Barbato <lu_zero at gentoo.org> | Tue Jul  9 04:44:26 2013 +0200| [40ee4de6a6a9f7af3b5bb8a690aa1cae0a752430] | committer: Luca Barbato

atrac3: Error on impossible encoding/channel combinations

Joint stereo encoded mono is impossible.

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
(cherry picked from commit 50cf5a7fb78846fc39b3ecdaa896a10bcd74da2a)

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

Conflicts:
	libavcodec/atrac3.c

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

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

diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index cc0cc7c..e31dd1d 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -976,6 +976,8 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
     if (q->codingMode == STEREO) {
         av_log(avctx,AV_LOG_DEBUG,"Normal stereo detected.\n");
     } else if (q->codingMode == JOINT_STEREO) {
+        if (avctx->channels != 2)
+            return AVERROR_INVALIDDATA;
         av_log(avctx,AV_LOG_DEBUG,"Joint stereo detected.\n");
     } else {
         av_log(avctx,AV_LOG_ERROR,"Unknown channel coding mode %x!\n",q->codingMode);



More information about the ffmpeg-cvslog mailing list