[FFmpeg-cvslog] avformat/adtsenc: allow only AAC streams

Gyan Doshi git at videolan.org
Sun Jan 14 15:13:31 EET 2018


ffmpeg | branch: master | Gyan Doshi <gyandoshi at gmail.com> | Sun Jan 14 17:48:23 2018 +0530| [96f94624e0a1a91134bd8e1e3127080b81716f6f] | committer: James Almer

avformat/adtsenc: allow only AAC streams

The ADTS muxer will silently (attempt to) mux any audio stream passed to it.
Patch adds a codec check.

Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavformat/adtsenc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c
index c24572f160..3c2840c6ab 100644
--- a/libavformat/adtsenc.c
+++ b/libavformat/adtsenc.c
@@ -99,6 +99,10 @@ static int adts_init(AVFormatContext *s)
     ADTSContext *adts = s->priv_data;
     AVCodecParameters *par = s->streams[0]->codecpar;
 
+    if (par->codec_id != AV_CODEC_ID_AAC) {
+        av_log(s, AV_LOG_ERROR, "Only AAC streams can be muxed by the ADTS muxer\n");
+        return AVERROR(EINVAL);
+    }
     if (par->extradata_size > 0)
         return adts_decode_extradata(s, adts, par->extradata,
                                      par->extradata_size);



More information about the ffmpeg-cvslog mailing list