]> git.alsa-project.org Git - alsa-tools.git/commitdiff
hdspmixer: fix null pointer dereference in HDSPMixerWindow:handler_cb
authorChristian Heldt <snaut@tutanota.com>
Sun, 30 Nov 2025 14:04:46 +0000 (15:04 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 7 Dec 2025 16:02:03 +0000 (17:02 +0100)
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>
hdspmixer/src/HDSPMixerWindow.cxx

index 4a911c18339bc46ff5a01540b2c2cac516e35dea..1450258bb580f2708dd49078729bd66989577816 100644 (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) {