From c63e56fe63ef42673f2891efac546a8876e19639 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 10 Oct 2023 15:43:07 -0400 Subject: [PATCH] v4l2codecs: Fix tiled formats stride conversion While adding arbitrary tile support, a round up operation was badly converter. This caused the Y component of the stride to be 0. This eventually lead to a crash in glupoad preceded by the following assertion. gst_gl_buffer_allocation_params_new: assertion 'alloc_size > 0' failed Part-of: --- subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2format.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2format.c b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2format.c index 64c47e1be7..11107421ad 100644 --- a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2format.c +++ b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2format.c @@ -86,10 +86,9 @@ set_stride (GstVideoInfo * info, gint plane, gint stride) padded_height = GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (finfo, plane, info->height); - padded_height = (padded_height + tile_height - 1) / tile_height; x_tiles = stride / GST_VIDEO_FORMAT_INFO_TILE_STRIDE (finfo, plane); - y_tiles = padded_height / tile_height; + y_tiles = (padded_height + tile_height - 1) / tile_height; info->stride[plane] = GST_VIDEO_TILE_MAKE_STRIDE (x_tiles, y_tiles); } else { info->stride[plane] = stride;