Commit d7dcd96a authored by Michael Niedermayer's avatar Michael Niedermayer

vf_pad: Fix alignment of get_video_buffer()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent d18fd13f
...@@ -251,9 +251,10 @@ static int config_output(AVFilterLink *outlink) ...@@ -251,9 +251,10 @@ static int config_output(AVFilterLink *outlink)
static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int w, int h) static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int w, int h)
{ {
PadContext *pad = inlink->dst->priv; PadContext *pad = inlink->dst->priv;
int align = (perms&AV_PERM_ALIGN) ? AVFILTER_ALIGN : 1;
AVFilterBufferRef *picref = avfilter_get_video_buffer(inlink->dst->outputs[0], perms, AVFilterBufferRef *picref = avfilter_get_video_buffer(inlink->dst->outputs[0], perms,
w + (pad->w - pad->in_w), w + (pad->w - pad->in_w) + 4*align,
h + (pad->h - pad->in_h)); h + (pad->h - pad->in_h));
int plane; int plane;
...@@ -264,7 +265,7 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int ...@@ -264,7 +265,7 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int
int hsub = (plane == 1 || plane == 2) ? pad->hsub : 0; int hsub = (plane == 1 || plane == 2) ? pad->hsub : 0;
int vsub = (plane == 1 || plane == 2) ? pad->vsub : 0; int vsub = (plane == 1 || plane == 2) ? pad->vsub : 0;
picref->data[plane] += (pad->x >> hsub) * pad->line_step[plane] + picref->data[plane] += FFALIGN(pad->x >> hsub, align) * pad->line_step[plane] +
(pad->y >> vsub) * picref->linesize[plane]; (pad->y >> vsub) * picref->linesize[plane];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment