[FFmpeg-cvslog] matroskadec: fix NULL pointer dereference in webm_dash_manifest_read_header

Andreas Cadhalpun git at videolan.org
Sun Nov 27 01:41:09 EET 2016


ffmpeg | branch: release/3.0 | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Tue Nov  8 00:42:23 2016 +0100| [5801482379cb053c2901da1058e86365aac563a1] | committer: Andreas Cadhalpun

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 at niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
(cherry picked from commit ff100c9dd97d2f1f456ff38b192edf84f9744738)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

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

 libavformat/matroskadec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index d788232..94c4639 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -3579,6 +3579,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);



More information about the ffmpeg-cvslog mailing list