mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
wlr_scene: Fix crash when committing NULL buffer
If we commit a null buffer, we want to avoid the buffer damage path and instead just update the node to avoid it.
This commit is contained in:
parent
341b3c8bd2
commit
2aebb8e444
1 changed files with 5 additions and 0 deletions
|
@ -669,6 +669,11 @@ void wlr_scene_buffer_set_buffer_with_damage(struct wlr_scene_buffer *scene_buff
|
||||||
bool mapped = buffer != NULL;
|
bool mapped = buffer != NULL;
|
||||||
bool prev_mapped = scene_buffer->buffer != NULL || scene_buffer->texture != NULL;
|
bool prev_mapped = scene_buffer->buffer != NULL || scene_buffer->texture != NULL;
|
||||||
|
|
||||||
|
if (!mapped && !prev_mapped) {
|
||||||
|
// unmapping already unmapped buffer - noop
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// if this node used to not be mapped or its previous displayed
|
// if this node used to not be mapped or its previous displayed
|
||||||
// buffer region will be different from what the new buffer would
|
// buffer region will be different from what the new buffer would
|
||||||
// produce we need to update the node.
|
// produce we need to update the node.
|
||||||
|
|
Loading…
Reference in a new issue