Browse Source

vf_format: check input validity

CC: libav-stable@libav.org
Vittorio Giovara 10 years ago
parent
commit
d1afd3e1d6
1 changed files with 5 additions and 0 deletions
  1. 5 0
      libavfilter/vf_format.c

+ 5 - 0
libavfilter/vf_format.c

@@ -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, '|'))) {