diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2013-01-02 11:17:07 +0100 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2013-01-04 11:48:53 +0100 |
commit | 4ea7c179325f61736040f2ff22c2f27c702727d4 (patch) | |
tree | ee4406df7b1258963806f6711a54ccc7a06f09cd /libavfilter/vf_yadif.c | |
parent | b52c1d0c993a9efe78cf3f0ba7c3850f15f25d6e (diff) | |
download | ffmpeg-4ea7c179325f61736040f2ff22c2f27c702727d4.tar.gz |
lavfi/yadif: fail during the configuration stage in case of invalid video size
This is better than repeatedly failing during the filtering stage.
Diffstat (limited to 'libavfilter/vf_yadif.c')
-rw-r--r-- | libavfilter/vf_yadif.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c index 061b9732a9..ed2ffd5968 100644 --- a/libavfilter/vf_yadif.c +++ b/libavfilter/vf_yadif.c @@ -219,11 +219,6 @@ static int filter_frame(AVFilterLink *link, AVFilterBufferRef *picref) av_assert0(picref); - if (picref->video->h < 3 || picref->video->w < 3) { - av_log(ctx, AV_LOG_ERROR, "Video of less than 3 columns or lines is not supported\n"); - return AVERROR(EINVAL); - } - if (yadif->frame_pending) return_frame(ctx, 1); @@ -369,7 +364,8 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static int config_props(AVFilterLink *link) { - YADIFContext *yadif = link->src->priv; + AVFilterContext *ctx = link->src; + YADIFContext *yadif = ctx->priv; link->time_base.num = link->src->inputs[0]->time_base.num; link->time_base.den = link->src->inputs[0]->time_base.den * 2; @@ -379,6 +375,11 @@ static int config_props(AVFilterLink *link) if(yadif->mode&1) link->frame_rate = av_mul_q(link->src->inputs[0]->frame_rate, (AVRational){2,1}); + if (link->w < 3 || link->h < 3) { + av_log(ctx, AV_LOG_ERROR, "Video of less than 3 columns or lines is not supported\n"); + return AVERROR(EINVAL); + } + return 0; } |