stream: Check pa_tagstruct_get_format_info() retval in pa_create_stream_callback()

CID 1137984
This commit is contained in:
Peter Meerwald-Stadler 2015-09-15 23:11:29 +02:00
parent f173f5a8a5
commit b3e4d28d25

View file

@ -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)) {