hdspmixer: fix null pointer dereference in HDSPMixerWindow:handler_cb

Closes: https://github.com/alsa-project/alsa-tools/pull/42
Signed-off-by: Christian Heldt <snaut@tutanota.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Christian Heldt 2025-11-30 15:04:46 +01:00 committed by Jaroslav Kysela
parent 4b4886b5f9
commit a3fd2c53b6

View file

@ -274,15 +274,15 @@ static int handler_cb(int event)
{
HDSPMixerWindow *w = NULL;
Fl_Window *fl_win = Fl::first_window();
while (1) {
if (fl_win->label()) {
if (strncmp("HDSPMixer", fl_win->label(), 9) == 0) {
w = (HDSPMixerWindow *)fl_win;
break;
while (fl_win) {
if (fl_win->label()) {
if (strncmp("HDSPMixer", fl_win->label(), 9) == 0) {
w = (HDSPMixerWindow *)fl_win;
break;
}
}
fl_win = Fl::next_window(fl_win);
}
if ((fl_win = Fl::next_window(fl_win))) return 0;
}
if (!w) return 0;
int key = Fl::event_key();
switch (event) {