diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-07-03 02:05:34 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-07-03 02:29:49 +0200 |
commit | 126524720661a9adddec758e94729007a96f07f7 (patch) | |
tree | d814af7138404ba6e599cc23382bfd9063ea083e | |
parent | 5ab67340f9d1ac79961a356d30a9967bb05b2c13 (diff) | |
download | ffmpeg-126524720661a9adddec758e94729007a96f07f7.tar.gz |
avfilter/vf_format: Check pix_fmts before dereferencing it
Fixes CID1224286
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavfilter/vf_format.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavfilter/vf_format.c b/libavfilter/vf_format.c index afa17fe8a2..13b41e4663 100644 --- a/libavfilter/vf_format.c +++ b/libavfilter/vf_format.c @@ -60,6 +60,9 @@ static av_cold int init(AVFilterContext *ctx) int i; int ret; + if (!s->pix_fmts) + return AVERROR(EINVAL); + /* count the formats */ cur = s->pix_fmts; while ((cur = strchr(cur, '|'))) { @@ -72,9 +75,6 @@ static av_cold int init(AVFilterContext *ctx) if (!s->formats) return AVERROR(ENOMEM); - if (!s->pix_fmts) - return AVERROR(EINVAL); - /* parse the list of formats */ cur = s->pix_fmts; for (i = 0; i < nb_formats; i++) { |