From e8cfc9249c3a468b8a2ae29c0f6768d5c50b4e4e Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Tue, 18 May 2021 03:15:20 +0300
Subject: [PATCH] music_wav.c (ParseLIST): ignore non-parsed data and always
return true.
Fixes: https://github.com/libsdl-org/SDL_mixer/issues/319
---
src/codecs/music_wav.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/codecs/music_wav.c b/src/codecs/music_wav.c
index 461ecf0..8dd2a98 100644
--- a/src/codecs/music_wav.c
+++ b/src/codecs/music_wav.c
@@ -825,9 +825,8 @@ static void read_meta_field(Mix_MusicMetaTags *tags, Mix_MusicMetaTag tag_type,
static SDL_bool ParseLIST(WAV_Music *wave, Uint32 chunk_length)
{
- SDL_bool loaded = SDL_FALSE;
-
Uint8 *data;
+
data = (Uint8 *)SDL_malloc(chunk_length);
if (!data) {
Mix_SetError("Out of memory");
@@ -857,13 +856,12 @@ static SDL_bool ParseLIST(WAV_Music *wave, Uint32 chunk_length)
}
i++;
}
- loaded = SDL_TRUE;
}
/* done: */
SDL_free(data);
- return loaded;
+ return SDL_TRUE;
}
static SDL_bool LoadWAVMusic(WAV_Music *wave)