aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_xfade.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-08-11 10:55:16 +0200
committerPaul B Mahol <onemda@gmail.com>2020-08-11 10:57:04 +0200
commit4dbb75c437117285cfa195c437a8a1ee898e9293 (patch)
tree1b05a14215bd99d41afe2f5c846c4642e73913c5 /libavfilter/vf_xfade.c
parent3f58dbca72abda8b4a0a8ccd08ec49e34fdb25e7 (diff)
downloadffmpeg-4dbb75c437117285cfa195c437a8a1ee898e9293.tar.gz
avfilter/vf_xfade: check that fps between inputs are valid
Diffstat (limited to 'libavfilter/vf_xfade.c')
-rw-r--r--libavfilter/vf_xfade.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/libavfilter/vf_xfade.c b/libavfilter/vf_xfade.c
index 6467838ad1..724be2f419 100644
--- a/libavfilter/vf_xfade.c
+++ b/libavfilter/vf_xfade.c
@@ -1411,6 +1411,22 @@ static int config_output(AVFilterLink *outlink)
return AVERROR(EINVAL);
}
+ if (!inlink0->frame_rate.num || !inlink0->frame_rate.den) {
+ av_log(ctx, AV_LOG_ERROR, "The inputs needs to be a constant frame rate; "
+ "current rate of %d/%d is invalid\n", inlink0->frame_rate.num, inlink0->frame_rate.den);
+ return AVERROR(EINVAL);
+ }
+
+ if (inlink0->frame_rate.num != inlink1->frame_rate.num ||
+ inlink0->frame_rate.den != inlink1->frame_rate.den) {
+ av_log(ctx, AV_LOG_ERROR, "First input link %s frame rate "
+ "(%d/%d) do not match the corresponding "
+ "second input link %s frame rate (%d/%d)\n",
+ ctx->input_pads[0].name, inlink0->frame_rate.num, inlink0->frame_rate.den,
+ ctx->input_pads[1].name, inlink1->frame_rate.num, inlink1->frame_rate.den);
+ return AVERROR(EINVAL);
+ }
+
outlink->w = inlink0->w;
outlink->h = inlink0->h;
outlink->time_base = inlink0->time_base;