fixed crash bug on info screen if music set has no unconfigured music
authorHolger Schemel <info@artsoft.org>
Thu, 8 Jun 2023 00:09:24 +0000 (02:09 +0200)
committerHolger Schemel <info@artsoft.org>
Thu, 8 Jun 2023 00:09:45 +0000 (02:09 +0200)
src/files.c

index c934db0fb414ce918421ed8913da260e8878b509..627cafc0ffe01e5450844a0fc13771da008b127c 100644 (file)
@@ -12985,13 +12985,17 @@ void LoadMusicInfo(void)
       // get music file info for configured level music
       music_nr = levelset.music[i];
     }
-    else
+    else if (num_music_noconf > 0)
     {
       // get music file info for unconfigured level music
       int level_pos = i - leveldir_current->first_level;
 
       music_nr = MAP_NOCONF_MUSIC(level_pos % num_music_noconf);
     }
+    else
+    {
+      continue;
+    }
 
     char *basename = getMusicInfoEntryFilename(music_nr);