mirror of
https://github.com/swaywm/sway.git
synced 2024-11-22 07:51:28 +00:00
Re-init renderer for all outputs on lost context
sway_root.outputs only include enabled outputs. We also need to re-init
the renderer for any disabled outputs, so use sway_root.all_outputs
instead.
Resolves the following heap-use-after-free accessing the render formats
when a disabled output is modeset after a GPU reset has occurred.
(cherry picked from commit c90cb37b2a
)
This commit is contained in:
parent
0de35b3585
commit
67ecc7d2cd
|
@ -204,8 +204,8 @@ static void handle_renderer_lost(struct wl_listener *listener, void *data) {
|
||||||
|
|
||||||
wlr_compositor_set_renderer(server->compositor, renderer);
|
wlr_compositor_set_renderer(server->compositor, renderer);
|
||||||
|
|
||||||
for (int i = 0; i < root->outputs->length; ++i) {
|
struct sway_output *output;
|
||||||
struct sway_output *output = root->outputs->items[i];
|
wl_list_for_each(output, &root->all_outputs, link) {
|
||||||
wlr_output_init_render(output->wlr_output,
|
wlr_output_init_render(output->wlr_output,
|
||||||
server->allocator, server->renderer);
|
server->allocator, server->renderer);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue