aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Orzechowski <orzechowski.alexander@gmail.com>2022-08-28 11:01:19 -0400
committerSimon Ser <contact@emersion.fr>2022-08-29 16:19:30 +0000
commitfe9e193ab5958760b1d6cbeb839fc2836bb124c9 (patch)
tree2249ba4534893abeffc0bc98b77262980e767977
parent7333a4602a333c8710ada6f8a16435745aa4a557 (diff)
wlr_scene: More sanity checking
The render list should neither contain scene trees or null buffers.
-rw-r--r--types/scene/wlr_scene.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/types/scene/wlr_scene.c b/types/scene/wlr_scene.c
index 5e5f8003..3088db7c 100644
--- a/types/scene/wlr_scene.c
+++ b/types/scene/wlr_scene.c
@@ -1043,7 +1043,7 @@ static void scene_node_render(struct wlr_scene_node *node,
enum wl_output_transform transform;
switch (node->type) {
case WLR_SCENE_NODE_TREE:
- /* Root or tree node has nothing to render itself */
+ assert(false);
break;
case WLR_SCENE_NODE_RECT:;
struct wlr_scene_rect *scene_rect = scene_rect_from_node(node);
@@ -1053,9 +1053,7 @@ static void scene_node_render(struct wlr_scene_node *node,
break;
case WLR_SCENE_NODE_BUFFER:;
struct wlr_scene_buffer *scene_buffer = wlr_scene_buffer_from_node(node);
- if (!scene_buffer->buffer) {
- return;
- }
+ assert(scene_buffer->buffer);
struct wlr_renderer *renderer = output->renderer;
texture = scene_buffer_get_texture(scene_buffer, renderer);