tPrevent crash when rendering frames without a texture - spkp - Stacking wayland compositor
(HTM) git clone git://git.z3bra.org/spkp.git
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit 2226711ec174f0a3b4efcb46cd57daad2fca92a2
(DIR) parent 1cc098d782f101b0661c607714d621b5cd494fdf
(HTM) Author: Willy Goiffon <dev@z3bra.org>
Date: Mon, 9 Nov 2020 17:57:47 +0100
Prevent crash when rendering frames without a texture
Diffstat:
M compositor.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/compositor.c b/compositor.c
t@@ -613,15 +613,19 @@ render(struct wlr_surface *surface, int x, int y, void *data)
window = rdata->window;
output = rdata->output;
+ texture = wlr_surface_get_texture(surface);
+ if (!texture)
+ return;
+
box.x = window->x + x;
box.y = window->y + y;
box.width = surface->current.width;
box.height = surface->current.height;
- texture = wlr_surface_get_texture(surface);
transform = wlr_output_transform_invert(surface->current.transform);
wlr_matrix_project_box(matrix, &box, transform, 0, output->transform_matrix);
+
wlr_render_texture_with_matrix(rdata->renderer, texture, matrix, 1);
wlr_surface_send_frame_done(surface, &rdata->when);
}