OSDN Git Service

avfilter/vf_format: check that the format list is not empty
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 5 Jan 2014 19:14:03 +0000 (20:14 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 5 Jan 2014 19:14:03 +0000 (20:14 +0100)
Fixes Ticket3210

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/vf_format.c

index 2e9ff27..98061e9 100644 (file)
@@ -55,6 +55,9 @@ static av_cold int init(AVFilterContext *ctx)
     int              pix_fmt_name_len, ret;
     enum AVPixelFormat pix_fmt;
 
+    if (!s->pix_fmts)
+        return AVERROR(EINVAL);
+
     /* parse the list of formats */
     for (cur = s->pix_fmts; cur; cur = sep ? sep + 1 : NULL) {
         if (!(sep = strchr(cur, '|')))