avformat/concat: Check protocol prefix
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 20 Jan 2016 10:10:27 +0000 (11:10 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 22 Jan 2016 23:12:54 +0000 (00:12 +0100)
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/concat.c

index 81fe970..7bcc279 100644 (file)
@@ -65,7 +65,10 @@ static av_cold int concat_open(URLContext *h, const char *uri, int flags)
     struct concat_data  *data = h->priv_data;
     struct concat_nodes *nodes;
 
-    av_strstart(uri, "concat:", &uri);
+    if (!av_strstart(uri, "concat:", &uri)) {
+        av_log(h, AV_LOG_ERROR, "URL %s lacks prefix\n", uri);
+        return AVERROR(EINVAL);
+    }
 
     for (i = 0, len = 1; uri[i]; i++) {
         if (uri[i] == *AV_CAT_SEPARATOR) {