This fixes a segmentation fault caused by controls trying to notify an
unregistered player.
When an unregistered player is replaced by another valid player from the
list, the session is not referenced in the sessions list of the player
and when this player is unregistered, its reference is not removed from
the session.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
if (target == NULL)
continue;
- if (target->player == player)
- target->player = g_slist_nth_data(server->players, 0);
+ if (target->player != player)
+ continue;
+
+ target->player = g_slist_nth_data(server->players, 0);
+ if (target->player)
+ target->player->sessions = g_slist_append(
+ target->player->sessions,
+ session);
}
avrcp_player_event(player,