mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	compositor crashes if window width or height is <= 0
This commit is contained in:
		
							parent
							
								
									762e5c25d6
								
							
						
					
					
						commit
						8a6f7e3139
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
					@ -1087,6 +1087,12 @@ handle_configure(void *data, struct wl_shell *shell,
 | 
				
			||||||
	struct window *window = wl_surface_get_user_data(surface);
 | 
						struct window *window = wl_surface_get_user_data(surface);
 | 
				
			||||||
	int32_t child_width, child_height;
 | 
						int32_t child_width, child_height;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* FIXME this is probably the wrong place to check for width or
 | 
				
			||||||
 | 
						   height <= 0, but it prevents the compositor from crashing
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
 | 
						if(width <= 0 || height <= 0)
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (window->resize_handler) {
 | 
						if (window->resize_handler) {
 | 
				
			||||||
		child_width = width - 20 - window->margin * 2;
 | 
							child_width = width - 20 - window->margin * 2;
 | 
				
			||||||
		child_height = height - 60 - window->margin * 2;
 | 
							child_height = height - 60 - window->margin * 2;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue