From 914525c3d52e264e6e7a05130571ae32989c62bd Mon Sep 17 00:00:00 2001 From: kub Date: Thu, 29 Jun 2023 19:54:07 +0000 Subject: [PATCH] mcd, fix no chd music in some cases --- pico/cd/cd_parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pico/cd/cd_parse.c b/pico/cd/cd_parse.c index 53c15d20..0a802ed3 100644 --- a/pico/cd/cd_parse.c +++ b/pico/cd/cd_parse.c @@ -172,7 +172,8 @@ cd_data_t *chd_parse(const char *fname) } memset(&data->tracks[count], 0, sizeof(data->tracks[0])); - data->tracks[count].fname = strdup(fname); + if (count == 1) + data->tracks[count].fname = strdup(fname); if (!strcmp(type, "MODE1_RAW") || !strcmp(type, "MODE2_RAW")) { data->tracks[count].type = CT_BIN; } else if (!strcmp(type, "MODE1") || !strcmp(type, "MODE2_FORM1")) { -- 2.39.5