]> code.delx.au - pulseaudio/commit
sink-input, source-output: Don't crash if format negotiation fails
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Wed, 12 Feb 2014 10:41:34 +0000 (12:41 +0200)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Fri, 14 Feb 2014 14:04:32 +0000 (16:04 +0200)
commitee1a96499447d0bc3458ab5075d05dbefcee225c
tree81996f05aff4d308eba662684d148ff92fcd1b87
parenta9dfc0731980503c9516b56d49b0ecf65e95b3dd
sink-input, source-output: Don't crash if format negotiation fails

A segfault was reported on this line:

pa_return_val_if_fail(PA_SINK_IS_LINKED(pa_sink_get_state(data->sink)), -PA_ERR_BADSTATE);

After expanding the pa_sink_get_state() macro, the line looks like
this:

pa_return_val_if_fail(PA_SINK_IS_LINKED(data->sink->state), -PA_ERR_BADSTATE);

So data->sink was apparently NULL. That could happen if we try to fall
back to the default sink, but format negotiation fails.

This bug was introduced in commit
71816ecb7f81fe7a124cefa2258cfa64046908a1.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=74646
src/pulsecore/sink-input.c
src/pulsecore/source-output.c