From d1afd3e1d6e43f4d37ae147091f270124ac48e04 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Sat, 18 Oct 2014 16:10:35 +0100 Subject: vf_format: check input validity CC: libav-stable@libav.org --- libavfilter/vf_format.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavfilter') diff --git a/libavfilter/vf_format.c b/libavfilter/vf_format.c index d37f870537..914089deab 100644 --- a/libavfilter/vf_format.c +++ b/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, '|'))) { -- cgit v1.2.3