summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Meerwald-Stadler <pmeerw@pmeerw.net>2015-09-15 23:11:29 +0200
committerPeter Meerwald-Stadler <pmeerw@pmeerw.net>2016-08-15 23:53:32 +0200
commitb3e4d28d2558bfb8ee359eb7d37b1751458d5529 (patch)
treedda5805f4b216d8fa8c2b451fe961868b25991e1
parentf173f5a8a507c7ca7b8e3459e446ed6622397dac (diff)
stream: Check pa_tagstruct_get_format_info() retval in pa_create_stream_callback()
CID 1137984
-rw-r--r--src/pulse/stream.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index 6fea9963..e10ab127 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -1137,18 +1137,16 @@ void pa_create_stream_callback(pa_pdispatch *pd, uint32_t command, uint32_t tag,
|| s->context->version >= 22) {
pa_format_info *f = pa_format_info_new();
- pa_tagstruct_get_format_info(t, f);
- if (pa_format_info_valid(f))
- s->format = f;
- else {
+ if (pa_tagstruct_get_format_info(t, f) < 0 || !pa_format_info_valid(f)) {
pa_format_info_free(f);
if (s->n_formats > 0) {
/* We used the extended API, so we should have got back a proper format */
pa_context_fail(s->context, PA_ERR_PROTOCOL);
goto finish;
}
- }
+ } else
+ s->format = f;
}
if (!pa_tagstruct_eof(t)) {