pcm_mixer: fix missing NULL check for play_cbs

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]> Thu, 23 Apr 2026 09:21:51 -0400
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit d1abd788d0b22de1d8165b01b8c69eb6cb1ccd2d
Author: Christian Soffke <[email protected]>
Date:   Thu Apr 23 14:15:46 2026 +0200

    pcm_mixer: fix missing NULL check for play_cbs
    
    Fixes Metronome plugin crashing
    (regression introduced in cb04b81)
    
    Does *not* fix missing Metronome sound
    (regression introduced in 017dd72)
    
    Change-Id: I1da9aa2c937b267a3d5b122c431eaa9f7e748440

diff --git a/firmware/pcm_mixer.c b/firmware/pcm_mixer.c
index fb12e53373..607db70839 100644
--- a/firmware/pcm_mixer.c
+++ b/firmware/pcm_mixer.c
@@ -163,7 +163,7 @@ fill_frame:
 
         if (chan->size == 0)
         {
-            if (chan->play_cbs->get_more)
+            if (chan->play_cbs && chan->play_cbs->get_more)
             {
                 chan->play_cbs->get_more(&chan->start, &chan->size);
                 ALIGN_AUDIOBUF(chan->start, chan->size);
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs