From 671b188013d3ce79a5de1fdcd45a82ca030d3856 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 c9fbd11e0..2981233ab 100644 --- a/src/capture_filter/change_pixfmt.c +++ b/src/capture_filter/change_pixfmt.c @@ -107,7 +107,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;