mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	spa: alsa: Add a NULL check before updating rate match
The RateMatch IO might be NULL for the driver, and trying to update rate matching with state->rate_match crashes in this case.
This commit is contained in:
		
							parent
							
								
									35dbaa840b
								
							
						
					
					
						commit
						5cbf3654c7
					
				
					 2 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
					@ -757,7 +757,8 @@ impl_node_port_set_io(void *object,
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case SPA_IO_RateMatch:
 | 
						case SPA_IO_RateMatch:
 | 
				
			||||||
		this->rate_match = data;
 | 
							this->rate_match = data;
 | 
				
			||||||
		spa_alsa_update_rate_match(this);
 | 
							if (this->rate_match)
 | 
				
			||||||
 | 
								spa_alsa_update_rate_match(this);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		return -ENOENT;
 | 
							return -ENOENT;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -687,7 +687,8 @@ impl_node_port_set_io(void *object,
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case SPA_IO_RateMatch:
 | 
						case SPA_IO_RateMatch:
 | 
				
			||||||
		this->rate_match = data;
 | 
							this->rate_match = data;
 | 
				
			||||||
		spa_alsa_update_rate_match(this);
 | 
							if (this->rate_match)
 | 
				
			||||||
 | 
								spa_alsa_update_rate_match(this);
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		return -ENOENT;
 | 
							return -ENOENT;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue