Commit d9c23a0d authored by Stefano Sabatini's avatar Stefano Sabatini

vf_transpose: avoid multiple calls to avfilter_draw_slice()

avfilter_draw_slice() is already called in the end_frame() callback,
this avoids multiple calls. This is done by adding a null draw_slice()
callback.

In particular fix crash occurring with -vf transpose=3,hflip, fix trac
issue #371.
parent 2dd2abe3
...@@ -195,6 +195,8 @@ static void end_frame(AVFilterLink *inlink) ...@@ -195,6 +195,8 @@ static void end_frame(AVFilterLink *inlink)
avfilter_unref_buffer(outpic); avfilter_unref_buffer(outpic);
} }
static void null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { }
AVFilter avfilter_vf_transpose = { AVFilter avfilter_vf_transpose = {
.name = "transpose", .name = "transpose",
.description = NULL_IF_CONFIG_SMALL("Transpose input video."), .description = NULL_IF_CONFIG_SMALL("Transpose input video."),
...@@ -207,6 +209,7 @@ AVFilter avfilter_vf_transpose = { ...@@ -207,6 +209,7 @@ AVFilter avfilter_vf_transpose = {
.inputs = (AVFilterPad[]) {{ .name = "default", .inputs = (AVFilterPad[]) {{ .name = "default",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.start_frame = start_frame, .start_frame = start_frame,
.draw_slice = null_draw_slice,
.end_frame = end_frame, .end_frame = end_frame,
.min_perms = AV_PERM_READ, }, .min_perms = AV_PERM_READ, },
{ .name = NULL}}, { .name = NULL}},
......
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