mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
stream: Check pa_tagstruct_get_format_info() retval in pa_create_stream_callback()
CID 1137984
This commit is contained in:
parent
f173f5a8a5
commit
b3e4d28d25
1 changed files with 3 additions and 5 deletions
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue