]> git.sesse.net Git - ffmpeg/commitdiff
avformat: don't crash API users when demuxing mp4
authorwm4 <nfxjfg@googlemail.com>
Tue, 14 Jul 2015 19:08:24 +0000 (21:08 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 14 Jul 2015 20:41:35 +0000 (22:41 +0200)
This code is one big chunk of WTF.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/utils.c

index a123a59177716a532deb37fad863ec1fe4d0bc24..c40b4d2b2736fbf910a7e889047e12da5c355cac 100644 (file)
@@ -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++) {