mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
alsa: don't crash on NULL params
This commit is contained in:
parent
57e732cd27
commit
16f1d6349d
2 changed files with 12 additions and 4 deletions
|
|
@ -353,7 +353,9 @@ static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
|
||||||
case SPA_PARAM_ProcessLatency:
|
case SPA_PARAM_ProcessLatency:
|
||||||
{
|
{
|
||||||
struct spa_process_latency_info info;
|
struct spa_process_latency_info info;
|
||||||
if ((res = spa_process_latency_parse(param, &info)) < 0)
|
if (param == NULL)
|
||||||
|
spa_zero(info);
|
||||||
|
else if ((res = spa_process_latency_parse(param, &info)) < 0)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
handle_process_latency(this, &info);
|
handle_process_latency(this, &info);
|
||||||
|
|
@ -694,7 +696,9 @@ impl_node_port_set_param(void *object,
|
||||||
case SPA_PARAM_Latency:
|
case SPA_PARAM_Latency:
|
||||||
{
|
{
|
||||||
struct spa_latency_info info;
|
struct spa_latency_info info;
|
||||||
if ((res = spa_latency_parse(param, &info)) < 0)
|
if (param == NULL)
|
||||||
|
info = SPA_LATENCY_INFO(SPA_DIRECTION_REVERSE(direction));
|
||||||
|
else if ((res = spa_latency_parse(param, &info)) < 0)
|
||||||
return res;
|
return res;
|
||||||
if (direction == info.direction)
|
if (direction == info.direction)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
|
||||||
|
|
@ -319,7 +319,9 @@ static int impl_node_set_param(void *object, uint32_t id, uint32_t flags,
|
||||||
case SPA_PARAM_ProcessLatency:
|
case SPA_PARAM_ProcessLatency:
|
||||||
{
|
{
|
||||||
struct spa_process_latency_info info;
|
struct spa_process_latency_info info;
|
||||||
if ((res = spa_process_latency_parse(param, &info)) < 0)
|
if (param == NULL)
|
||||||
|
spa_zero(info);
|
||||||
|
else if ((res = spa_process_latency_parse(param, &info)) < 0)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
handle_process_latency(this, &info);
|
handle_process_latency(this, &info);
|
||||||
|
|
@ -631,7 +633,9 @@ impl_node_port_set_param(void *object,
|
||||||
case SPA_PARAM_Latency:
|
case SPA_PARAM_Latency:
|
||||||
{
|
{
|
||||||
struct spa_latency_info info;
|
struct spa_latency_info info;
|
||||||
if ((res = spa_latency_parse(param, &info)) < 0)
|
if (param == NULL)
|
||||||
|
info = SPA_LATENCY_INFO(SPA_DIRECTION_REVERSE(direction));
|
||||||
|
else if ((res = spa_latency_parse(param, &info)) < 0)
|
||||||
return res;
|
return res;
|
||||||
if (direction == info.direction)
|
if (direction == info.direction)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue