diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-12-14 21:18:39 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-12-14 21:46:05 +0100 |
commit | 30fe3fd52721c8c6566001192cd16be423ffc92b (patch) | |
tree | 8c723620ff09ca2af8318176e5897bd25ad73e92 /libavfilter | |
parent | 22e960ad478e568f4094971a58c6ad8f549c0180 (diff) | |
download | ffmpeg-30fe3fd52721c8c6566001192cd16be423ffc92b.tar.gz |
avfilter/vf_decimate: Check that input parameters match
Fixes Ticket4964
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_decimate.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c index e580d05027..a79fc02ec3 100644 --- a/libavfilter/vf_decimate.c +++ b/libavfilter/vf_decimate.c @@ -362,6 +362,8 @@ static int config_output(AVFilterLink *outlink) DecimateContext *dm = ctx->priv; const AVFilterLink *inlink = ctx->inputs[dm->ppsrc ? INPUT_CLEANSRC : INPUT_MAIN]; + const AVFilterLink *inlink_main = + ctx->inputs[INPUT_MAIN]; AVRational fps = inlink->frame_rate; if (!fps.num || !fps.den) { @@ -369,6 +371,13 @@ static int config_output(AVFilterLink *outlink) "current rate of %d/%d is invalid\n", fps.num, fps.den); return AVERROR(EINVAL); } + + if (inlink->w != inlink_main->w || + inlink->h != inlink_main->h || + inlink->format != inlink_main->format) { + av_log(ctx, AV_LOG_ERROR, "frame parameters differ between inputs\n"); + return AVERROR_PATCHWELCOME; + } fps = av_mul_q(fps, (AVRational){dm->cycle - 1, dm->cycle}); av_log(ctx, AV_LOG_VERBOSE, "FPS: %d/%d -> %d/%d\n", inlink->frame_rate.num, inlink->frame_rate.den, fps.num, fps.den); |