mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 05:59:10 +00:00
v4l2: 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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5458>
This commit is contained in:
parent
88fd9908fe
commit
bcfbdfbbca
1 changed files with 1 additions and 2 deletions
|
@ -3438,10 +3438,9 @@ gst_v4l2_object_set_stride (GstVideoInfo * info, GstVideoAlignment * align,
|
||||||
|
|
||||||
padded_height = GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (finfo, plane,
|
padded_height = GST_VIDEO_FORMAT_INFO_SCALE_HEIGHT (finfo, plane,
|
||||||
info->height + align->padding_top + align->padding_bottom);
|
info->height + align->padding_top + align->padding_bottom);
|
||||||
padded_height = (padded_height + tile_height - 1) / tile_height;
|
|
||||||
|
|
||||||
x_tiles = stride / GST_VIDEO_FORMAT_INFO_TILE_STRIDE (finfo, plane);
|
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);
|
info->stride[plane] = GST_VIDEO_TILE_MAKE_STRIDE (x_tiles, y_tiles);
|
||||||
} else {
|
} else {
|
||||||
info->stride[plane] = stride;
|
info->stride[plane] = stride;
|
||||||
|
|
Loading…
Reference in a new issue