aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/drm/drm.c3
-rw-r--r--types/wlr_surface.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index e65ca696..65ea7f45 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -405,7 +405,7 @@ static void realloc_crtcs(struct wlr_drm_backend *backend,
memset(possible_crtc, 0, sizeof(possible_crtc));
- size_t index;
+ ssize_t index = -1;
for (size_t i = 0; i < backend->outputs->length; ++i) {
struct wlr_drm_output *o = backend->outputs->items[i];
if (o == output) {
@@ -419,6 +419,7 @@ static void realloc_crtcs(struct wlr_drm_backend *backend,
possible_crtc[i] = o->possible_crtc;
crtc[o->crtc - backend->crtcs] = i;
}
+ assert(index != -1);
possible_crtc[index] = output->possible_crtc;
match_obj(backend->outputs->length, possible_crtc,
diff --git a/types/wlr_surface.c b/types/wlr_surface.c
index 43f8f65a..240360a1 100644
--- a/types/wlr_surface.c
+++ b/types/wlr_surface.c
@@ -292,7 +292,8 @@ release:
pixman_region32_fini(&surface->current.buffer_damage);
pixman_region32_init(&surface->current.buffer_damage);
- wl_resource_queue_event(surface->current.buffer, WL_BUFFER_RELEASE);
+ wl_resource_post_event(surface->current.buffer, WL_BUFFER_RELEASE);
+ surface->current.buffer = NULL;
}
static void surface_set_buffer_transform(struct wl_client *client,