mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	libcamera: handle failure gracefully
Don't try to access NULL pointers
This commit is contained in:
		
							parent
							
								
									f8817b4394
								
							
						
					
					
						commit
						d71a10b7fa
					
				
					 3 changed files with 9 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -994,10 +994,10 @@ impl_init(const struct spa_handle_factory *factory,
 | 
			
		|||
	port->dev.log = this->log;
 | 
			
		||||
	port->dev.fd = -1;
 | 
			
		||||
 | 
			
		||||
	if(port->dev.camera == NULL) {
 | 
			
		||||
	if(port->dev.camera == NULL)
 | 
			
		||||
		port->dev.camera = (LibCamera*)newLibCamera();
 | 
			
		||||
	if(port->dev.camera != NULL)
 | 
			
		||||
		libcamera_set_log(port->dev.camera, port->dev.log);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (info && (str = spa_dict_lookup(info, SPA_KEY_API_LIBCAMERA_PATH))) {
 | 
			
		||||
		strncpy(this->props.device, str, 63);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue