aboutsummaryrefslogtreecommitdiff
path: root/render/allocator/shm.c
diff options
context:
space:
mode:
Diffstat (limited to 'render/allocator/shm.c')
-rw-r--r--render/allocator/shm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/render/allocator/shm.c b/render/allocator/shm.c
index 55a8fab2..b6d3138c 100644
--- a/render/allocator/shm.c
+++ b/render/allocator/shm.c
@@ -17,7 +17,8 @@ static const struct wlr_buffer_impl buffer_impl;
static struct wlr_shm_buffer *shm_buffer_from_buffer(
struct wlr_buffer *wlr_buffer) {
assert(wlr_buffer->impl == &buffer_impl);
- return (struct wlr_shm_buffer *)wlr_buffer;
+ struct wlr_shm_buffer *buffer = wl_container_of(wlr_buffer, buffer, base);
+ return buffer;
}
static void buffer_destroy(struct wlr_buffer *wlr_buffer) {