summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/protocol-esound.c
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2011-06-08 20:18:12 +0100
committerColin Guthrie <colin@mageia.org>2011-06-22 22:45:28 +0100
commitec4fa4c668a61de8ed7c9452e73919ba0bb1a870 (patch)
tree2cd3643615f5124322efa2b79a08d9c94c951cbc /src/pulsecore/protocol-esound.c
parent32927c50a8fef49f8a24eee82bf4ca64253a3dfc (diff)
esound,streams: Fix some crashes.
After the rework to the add pa_sink_input_new_data_set_sink() (and the source equiv) calling with a NULL sink object will hit an assert. This caused crashes with the esd protocol and there was the potential (albeit unlikely) for a crash when creating a sink input without any sinks available (module-always-sink mitigates this risk but it's still a potential crasher).
Diffstat (limited to 'src/pulsecore/protocol-esound.c')
-rw-r--r--src/pulsecore/protocol-esound.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pulsecore/protocol-esound.c b/src/pulsecore/protocol-esound.c
index edca96a1..484821c5 100644
--- a/src/pulsecore/protocol-esound.c
+++ b/src/pulsecore/protocol-esound.c
@@ -426,7 +426,8 @@ static int esd_proto_stream_play(connection *c, esd_proto_t request, const void
sdata.driver = __FILE__;
sdata.module = c->options->module;
sdata.client = c->client;
- pa_sink_input_new_data_set_sink(&sdata, sink, FALSE);
+ if (sink)
+ pa_sink_input_new_data_set_sink(&sdata, sink, FALSE);
pa_sink_input_new_data_set_sample_spec(&sdata, &ss);
pa_sink_input_new(&c->sink_input, c->protocol->core, &sdata);
@@ -524,7 +525,8 @@ static int esd_proto_stream_record(connection *c, esd_proto_t request, const voi
sdata.driver = __FILE__;
sdata.module = c->options->module;
sdata.client = c->client;
- pa_source_output_new_data_set_source(&sdata, source, FALSE);
+ if (source)
+ pa_source_output_new_data_set_source(&sdata, source, FALSE);
pa_source_output_new_data_set_sample_spec(&sdata, &ss);
pa_source_output_new(&c->source_output, c->protocol->core, &sdata);