jack: improve _is_mine() check

Also check the client, in case someone uses a port from another
client.
This commit is contained in:
Wim Taymans 2021-10-01 09:21:27 +02:00
parent 3dde9fef9c
commit a559b96d61

View file

@ -4219,7 +4219,9 @@ int jack_port_is_mine (const jack_client_t *client, const jack_port_t *port)
{
struct object *o = (struct object *) port;
spa_return_val_if_fail(o != NULL, 0);
return o->type == INTERFACE_Port && o->port.port_id != SPA_ID_INVALID;
return o->type == INTERFACE_Port &&
o->port.port != NULL &&
o->port.port->client == (struct client*)client;
}
SPA_EXPORT