mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	cursor: unset wlr_output_cursor.texture on surface destroy
When the surface is destroyed, its current wlr_texture is about to get destroyed as well. Reset wlr_output_cursor.texture to prevent use-after-free. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3652
This commit is contained in:
		
							parent
							
								
									9c9e3f6263
								
							
						
					
					
						commit
						6668c822b3
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
					@ -424,6 +424,7 @@ static void output_cursor_output_handle_surface_destroy(
 | 
				
			||||||
	struct wlr_cursor_output_cursor *output_cursor =
 | 
						struct wlr_cursor_output_cursor *output_cursor =
 | 
				
			||||||
		wl_container_of(listener, output_cursor, surface_destroy);
 | 
							wl_container_of(listener, output_cursor, surface_destroy);
 | 
				
			||||||
	assert(output_cursor->surface != NULL);
 | 
						assert(output_cursor->surface != NULL);
 | 
				
			||||||
 | 
						wlr_output_cursor_set_buffer(output_cursor->output_cursor, NULL, 0, 0);
 | 
				
			||||||
	cursor_output_cursor_reset_image(output_cursor);
 | 
						cursor_output_cursor_reset_image(output_cursor);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue