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

Fixes Ticket3210

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ee16e0cacc16ea60c35a66796410012755263c3c)
This commit is contained in:
Michael Niedermayer 2014-01-05 20:14:03 +01:00 committed by Carl Eugen Hoyos
parent 8763aca389
commit edc6f3da0e

View 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, '|')))