diff --git a/libavfilter/vf_vflip.c b/libavfilter/vf_vflip.c index 95d90d39e6..2ff44411b3 100644 --- a/libavfilter/vf_vflip.c +++ b/libavfilter/vf_vflip.c @@ -60,21 +60,22 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms, return picref; } -static void start_frame(AVFilterLink *link, AVFilterBufferRef *picref) +static void start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref) { FlipContext *flip = link->dst->priv; + AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0); int i; for (i = 0; i < 4; i ++) { int vsub = i == 1 || i == 2 ? flip->vsub : 0; - if (picref->data[i]) { - picref->data[i] += ((link->h >> vsub)-1) * picref->linesize[i]; - picref->linesize[i] = -picref->linesize[i]; + if (outpicref->data[i]) { + outpicref->data[i] += ((link->h >> vsub)-1) * outpicref->linesize[i]; + outpicref->linesize[i] = -outpicref->linesize[i]; } } - avfilter_start_frame(link->dst->outputs[0], picref); + avfilter_start_frame(link->dst->outputs[0], outpicref); } static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir) @@ -95,7 +96,6 @@ AVFilter avfilter_vf_vflip = { .get_video_buffer = get_video_buffer, .start_frame = start_frame, .draw_slice = draw_slice, - .end_frame = avfilter_null_end_frame, .config_props = config_input, }, { .name = NULL}}, .outputs = (AVFilterPad[]) {{ .name = "default",