Browse Source

avfilter/vf_format: check that the format list is not empty

Fixes Ticket3210

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.2-rc1
Michael Niedermayer 11 years ago
parent
commit
ee16e0cacc
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavfilter/vf_format.c

+ 3
- 0
libavfilter/vf_format.c View File

@@ -55,6 +55,9 @@ static av_cold int init(AVFilterContext *ctx)
int pix_fmt_name_len, ret; int pix_fmt_name_len, ret;
enum AVPixelFormat pix_fmt; enum AVPixelFormat pix_fmt;


if (!s->pix_fmts)
return AVERROR(EINVAL);

/* parse the list of formats */ /* parse the list of formats */
for (cur = s->pix_fmts; cur; cur = sep ? sep + 1 : NULL) { for (cur = s->pix_fmts; cur; cur = sep ? sep + 1 : NULL) {
if (!(sep = strchr(cur, '|'))) if (!(sep = strchr(cur, '|')))


Loading…
Cancel
Save