vf_format: check input validity
authorVittorio Giovara <vittorio.giovara@gmail.com>
Sat, 18 Oct 2014 15:10:35 +0000 (16:10 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 12 Jan 2015 23:01:08 +0000 (00:01 +0100)
CC: libav-stable@libav.org
libavfilter/vf_format.c

index d37f870..914089d 100644 (file)
@@ -59,6 +59,11 @@ static av_cold int init(AVFilterContext *ctx)
     int nb_formats = 1;
     int i;
 
+    if (!s->pix_fmts) {
+        av_log(ctx, AV_LOG_ERROR, "Empty output format string.\n");
+        return AVERROR(EINVAL);
+    }
+
     /* count the formats */
     cur = s->pix_fmts;
     while ((cur = strchr(cur, '|'))) {