From 39797095bd47ad6e2e3796d673ae1ae09f0d2bfc Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 30 Aug 2024 10:59:51 +0200 Subject: [PATCH] change_pixfmt: added buffer padding Pixelformat conversion suppose buffers with additional padding to handle "odd" resolutions that doesn't match the pixfmt native block size. Eg. this change fixes: ``` uv -t testcard:codec=R12L:size=1922x1080 -d gl -p change_pixfmt:RG48 ``` --- src/capture_filter/change_pixfmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/capture_filter/change_pixfmt.c b/src/capture_filter/change_pixfmt.c index f17762a22..da4d8f527 100644 --- a/src/capture_filter/change_pixfmt.c +++ b/src/capture_filter/change_pixfmt.c @@ -99,7 +99,7 @@ static struct video_frame *filter(void *state, struct video_frame *in) if (s->vo_pp_out_buffer) { out->tiles[0].data = s->vo_pp_out_buffer; } else { - out->tiles[0].data = malloc(out->tiles[0].data_len); + out->tiles[0].data = malloc(out->tiles[0].data_len + MAX_PADDING); out->callbacks.data_deleter = vf_data_deleter; } out->callbacks.dispose = vf_free;