aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/adtsenc.c
diff options
context:
space:
mode:
authorGyan Doshi <gyandoshi@gmail.com>2018-01-14 17:30:23 +0530
committerJames Almer <jamrial@gmail.com>2018-01-14 09:57:51 -0300
commit96f94624e0a1a91134bd8e1e3127080b81716f6f (patch)
tree4601a7f7986371cc036261c77e7ce46f1168bfed /libavformat/adtsenc.c
parent02dba49dd3f02c0b2d4f4740597a3062d6c4981c (diff)
downloadffmpeg-96f94624e0a1a91134bd8e1e3127080b81716f6f.tar.gz
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@gmail.com>
Diffstat (limited to 'libavformat/adtsenc.c')
-rw-r--r--libavformat/adtsenc.c4
1 files changed, 4 insertions, 0 deletions
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);