[FFmpeg-cvslog] avformat: don't crash API users when demuxing mp4

wm4 git at videolan.org
Tue Jul 14 22:53:29 CEST 2015


ffmpeg | branch: master | wm4 <nfxjfg at googlemail.com> | Tue Jul 14 21:08:24 2015 +0200| [130a8e0eef2f81e0d853117e417b650c3e16d1b7] | committer: Michael Niedermayer

avformat: don't crash API users when demuxing mp4

This code is one big chunk of WTF.

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index a123a59..c40b4d2 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1788,7 +1788,7 @@ void ff_configure_buffers_for_index(AVFormatContext *s, int64_t time_tolerance)
     //We could use URLProtocol flags here but as many user applications do not use URLProtocols this would be unreliable
     const char *proto = avio_find_protocol_name(s->filename);
 
-    if (!(strcmp(proto, "file") && strcmp(proto, "pipe") && strcmp(proto, "cache")))
+    if (proto && !(strcmp(proto, "file") && strcmp(proto, "pipe") && strcmp(proto, "cache")))
         return;
 
     for (ist1 = 0; ist1 < s->nb_streams; ist1++) {



More information about the ffmpeg-cvslog mailing list