diff options
Diffstat (limited to 'render/allocator/shm.c')
-rw-r--r-- | render/allocator/shm.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/render/allocator/shm.c b/render/allocator/shm.c index 9e49a144..55a8fab2 100644 --- a/render/allocator/shm.c +++ b/render/allocator/shm.c @@ -71,8 +71,7 @@ static struct wlr_buffer *allocator_create_buffer( wlr_buffer_init(&buffer->base, &buffer_impl, width, height); // TODO: consider using a single file for multiple buffers - int bytes_per_pixel = info->bpp / 8; - int stride = width * bytes_per_pixel; // TODO: align? + int stride = pixel_format_info_min_stride(info, width); // TODO: align? buffer->size = stride * height; buffer->shm.fd = allocate_shm_file(buffer->size); if (buffer->shm.fd < 0) { |