Segfault when attempting to play with a NULL selected_source
@nirbheek
Submitted by Nirbheek Chauhan Link to original bug (#695176)
Description
Once RB is started, if you select a source in the left pane that doesn't support playback with the "Play" button (such as the Last.fm plugin), the "Play" button is disabled, but playback can still be initiated by other means, such as the mpris DBus API, and multimedia keys.
Doing so causes a crash because in rb_shell_player_playpause(), selected_source is NULL, and hence rb_shell_player_set_playing_source() sets player->priv->source as NULL, causing a segfault in rb_source_get_entry_view.
#0 0x00007ffff7ad3e22 in rb_source_get_entry_view (source=0x0) at rb-source.c:660
klass = 0x100936820
#1 0x00007ffff7ac7814 in rb_shell_player_playpause (player=0x936820, unused=1, error=0x7fffffffd450) at rb-shell-player.c:1456
selection = 0x0
entry = 0x0
new_source = 0x0
out_of_order = 0
ret = 1
songs = 0xffffffffffffd3e0
__FUNCTION__ = "rb_shell_player_playpause"
__PRETTY_FUNCTION__ = "rb_shell_player_playpause"
[snip]
I'm unsure whether the function should try harder to find a valid source, or just return if selected_source is NULL. If it should just return, should it return TRUE or FALSE?
Version: HEAD