Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGyan Doshi <ffmpeg@gyani.pro>2020-01-15 18:39:38 +0300
committerGyan Doshi <ffmpeg@gyani.pro>2020-01-19 08:47:53 +0300
commit4de2106fbf5301e0f504849f098abc3057f87599 (patch)
tree2f35c1ca6dcbdc03bf199a076e57cd8bc797dba4 /libavfilter/vf_pad.c
parentf8990c5f414d4575415e2a3981c3b142222ca3d4 (diff)
avfilter/pad: improve error check for w and h
Target dimensions have to cover entire input.
Diffstat (limited to 'libavfilter/vf_pad.c')
-rw-r--r--libavfilter/vf_pad.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
index 186d3f028d..e86292eaa2 100644
--- a/libavfilter/vf_pad.c
+++ b/libavfilter/vf_pad.c
@@ -178,14 +178,14 @@ static int config_input(AVFilterLink *inlink)
if (s->y < 0 || s->y + inlink->h > s->h)
s->y = var_values[VAR_Y] = (s->h - inlink->h) / 2;
+ s->w = ff_draw_round_to_sub(&s->draw, 0, -1, s->w);
+ s->h = ff_draw_round_to_sub(&s->draw, 1, -1, s->h);
/* sanity check params */
- if (s->w < 0 || s->h < 0) {
- av_log(ctx, AV_LOG_ERROR, "Negative values are not acceptable.\n");
+ if (s->w < inlink->w || s->h < inlink->h) {
+ av_log(ctx, AV_LOG_ERROR, "Padded dimensions cannot be smaller than input dimensions.\n");
return AVERROR(EINVAL);
}
- s->w = ff_draw_round_to_sub(&s->draw, 0, -1, s->w);
- s->h = ff_draw_round_to_sub(&s->draw, 1, -1, s->h);
s->x = ff_draw_round_to_sub(&s->draw, 0, -1, s->x);
s->y = ff_draw_round_to_sub(&s->draw, 1, -1, s->y);
s->in_w = ff_draw_round_to_sub(&s->draw, 0, -1, inlink->w);