mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
stream: check for NULL context
If a stream was killed, the context is cleared. Disconnecting a killed stream should not crash but return BADSTATE.
This commit is contained in:
parent
65798ca566
commit
64fc8dda20
1 changed files with 1 additions and 0 deletions
|
|
@ -1145,6 +1145,7 @@ int pa_stream_disconnect(pa_stream *s)
|
|||
spa_assert(s);
|
||||
spa_assert(s->refcount >= 1);
|
||||
|
||||
PA_CHECK_VALIDITY(c, c != NULL, PA_ERR_BADSTATE);
|
||||
PA_CHECK_VALIDITY(c, c->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
|
||||
|
||||
pw_log_debug("stream %p: disconnect", s);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue