diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-11-08 00:42:23 +0100 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-11-27 00:28:04 +0100 |
commit | c19e9657049d1ac67aee658b2f7ad12ba051b0cd (patch) | |
tree | dcd2c1de31540eecec90173b131f60fff177553c | |
parent | a40189348710e37fe25fc72ef71a05ec53c138f1 (diff) | |
download | ffmpeg-c19e9657049d1ac67aee658b2f7ad12ba051b0cd.tar.gz |
matroskadec: fix NULL pointer dereference in webm_dash_manifest_read_header
The code assumes that s->streams[0] is valid.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit ff100c9dd97d2f1f456ff38b192edf84f9744738)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r-- | libavformat/matroskadec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index f3d701fe4d..3c7ab1c9c5 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -3749,6 +3749,11 @@ static int webm_dash_manifest_read_header(AVFormatContext *s) av_log(s, AV_LOG_ERROR, "Failed to read file headers\n"); return -1; } + if (!s->nb_streams) { + matroska_read_close(s); + av_log(s, AV_LOG_ERROR, "No streams found\n"); + return AVERROR_INVALIDDATA; + } if (!matroska->is_live) { buf = av_asprintf("%g", matroska->duration); |