summaryrefslogtreecommitdiffstats
path: root/src/pulse
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-01-12 03:01:27 +0100
committerColin Guthrie <cguthrie@mandriva.org>2010-02-09 22:31:01 +0000
commit9ac12b7048b466effa551bd707648f66df18fe8a (patch)
tree274de400da62bc7168891cf75e53c110072e8686 /src/pulse
parent7ab9bea29dc9b3174be6b6a3a557c934b8265533 (diff)
client: verify connection state in pa_stream_connect_upload()
Make suer we check the connection state before going on, so that we can rely that s->context->pstream is properly initialized. https://bugzilla.redhat.com/show_bug.cgi?id=539500
Diffstat (limited to 'src/pulse')
-rw-r--r--src/pulse/scache.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pulse/scache.c b/src/pulse/scache.c
index 2a7602fd..b2169b6e 100644
--- a/src/pulse/scache.c
+++ b/src/pulse/scache.c
@@ -49,6 +49,7 @@ int pa_stream_connect_upload(pa_stream *s, size_t length) {
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_UNCONNECTED, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, length > 0, PA_ERR_INVALID);
PA_CHECK_VALIDITY(s->context, length == (size_t) (uint32_t) length, PA_ERR_INVALID);
+ PA_CHECK_VALIDITY(s->context, s->context->state == PA_CONTEXT_READY, PA_ERR_BADSTATE);
if (!(name = pa_proplist_gets(s->proplist, PA_PROP_EVENT_ID)))
name = pa_proplist_gets(s->proplist, PA_PROP_MEDIA_NAME);