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,6 +757,7 @@ 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;
|
||||||
|
if (this->rate_match)
|
||||||
spa_alsa_update_rate_match(this);
|
spa_alsa_update_rate_match(this);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -687,6 +687,7 @@ 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;
|
||||||
|
if (this->rate_match)
|
||||||
spa_alsa_update_rate_match(this);
|
spa_alsa_update_rate_match(this);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue