diff options
author | Derek Buitenhuis <[email protected]> | 2017-04-20 13:14:42 +0100 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2017-05-17 20:35:19 +0200 |
commit | 351dc1f33a65e221172c22d5569de2df2997fe24 (patch) | |
tree | 9f330e477d80f200a86e07e8224b4af416809a41 | |
parent | 70e26e9c25d3f5d90d88b88563436d68135e257d (diff) |
avformat/webmdashenc: Require the 'adaptation_sets' option to be set
This seems to be non-optional, and if the muxer is run without it,
strlen() is run on NULL, causing a segfault.
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit cbd3a68f3e1c2d1679370301eb5e1a32a2df64fe)
Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavformat/webmdashenc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c index 301c045b41..cf536129e4 100644 --- a/libavformat/webmdashenc.c +++ b/libavformat/webmdashenc.c @@ -428,6 +428,10 @@ static int parse_adaptation_sets(AVFormatContext *s) char *p = w->adaptation_sets; char *q; enum { new_set, parsed_id, parsing_streams } state; + if (!w->adaptation_sets) { + av_log(s, AV_LOG_ERROR, "The 'adaptation_sets' option must be set.\n"); + return AVERROR(EINVAL); + } // syntax id=0,streams=0,1,2 id=1,streams=3,4 and so on state = new_set; while (p < w->adaptation_sets + strlen(w->adaptation_sets)) { |