From 416dc48bcfc4e693b787fe06578a561c91b79c10 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Mon, 25 Sep 2023 16:38:48 -0400 Subject: [PATCH] 2023-09-25 Fred Gleason * Incremented the package version to 4.1.0fix0. Signed-off-by: Fred Gleason --- ChangeLog | 3 +++ lib/rdsound_panel.cpp | 15 +++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index bd6b42c4..37eb323c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24344,3 +24344,6 @@ segfault when switching user context. 2023-09-25 Fred Gleason * Incremented the package version to 4.1.0fix0. +2023-09-25 Fred Gleason + * Fixed a bug in rdairplay(1) and rdpanel(1) that could cause a + segfault when switching user context. diff --git a/lib/rdsound_panel.cpp b/lib/rdsound_panel.cpp index 1658ed64..791a61f7 100644 --- a/lib/rdsound_panel.cpp +++ b/lib/rdsound_panel.cpp @@ -1701,13 +1701,16 @@ void RDSoundPanel::Stopped(int id) void RDSoundPanel::ClearChannel(int id) { RDPlayDeck *playdeck=panel_active_buttons[id]->playDeck(); - if(rda->cae()-> - playPortActive(playdeck->card(),playdeck->port(),playdeck->stream())) { - return; + if(playdeck!=NULL) { + if(rda->cae()-> + playPortActive(playdeck->card(),playdeck->port(),playdeck->stream())) { + return; + } + panel_event_player-> + exec(panel_stop_rml[panel_active_buttons[id]->output()]); + emit channelStopped(panel_active_buttons[id]->output(), + playdeck->card(),playdeck->port()); } - panel_event_player->exec(panel_stop_rml[panel_active_buttons[id]->output()]); - emit channelStopped(panel_active_buttons[id]->output(), - playdeck->card(),playdeck->port()); }