rescue-streams: Fix segfault in some conditions

There is a call to this function where 'skip' variable is NULL. Looks
like this code doesn't get hit very often, probably because a suitable
default sink can be found to move the stream to. However, if we can't
move to the default sink and skip is NULL, there will be a segfault.
This commit is contained in:
Arun Raghavan 2010-12-02 16:30:59 +05:30 committed by Colin Guthrie
parent f6574c8c22
commit bd769fa98a

View file

@ -159,7 +159,7 @@ static pa_source* find_evacuation_source(pa_core *c, pa_source_output *o, pa_sou
if (target == skip) if (target == skip)
continue; continue;
if (!target->monitor_of != !skip->monitor_of) if (skip && !target->monitor_of != !skip->monitor_of)
continue; continue;
if (!PA_SOURCE_IS_LINKED(pa_source_get_state(target))) if (!PA_SOURCE_IS_LINKED(pa_source_get_state(target)))