playbin: avoid possible deference of null pointer

For safety, check the pointer playbin->curr_group is valid before
reading parameters of the structure.

CID #1291624
This commit is contained in:
Luis de Bethencourt 2015-03-30 10:50:45 +01:00
parent d1f91723be
commit 985ed4847f

View file

@ -5734,11 +5734,13 @@ failure:
GstSourceGroup *curr_group;
curr_group = playbin->curr_group;
if (curr_group && curr_group->active && curr_group->valid) {
/* unlink our pads with the sink */
deactivate_group (playbin, curr_group);
if (curr_group) {
if (curr_group->active && curr_group->valid) {
/* unlink our pads with the sink */
deactivate_group (playbin, curr_group);
}
curr_group->valid = FALSE;
}
curr_group->valid = FALSE;
/* Swap current and next group back */
playbin->curr_group = playbin->next_group;