mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
[raudio] Fix load and unload issues with Music (#1588)
* Add MUSIC_AUDIO_NONE to MusicContextType and format fixes - Useful to check the context type to see if the format is recognized. Defaulting to wav causes issues where formats are assumed to be wav. * Fix memory issues with LoadMusicStream and UnloadMusicStream - Set ctxType and ctxData even if the format fails to load. - Set ctxData to NULL if it fails and check for null inside UnloadMusicStream. - Change RL_MALLOC when loading formats to RL_CALLOC to prevent undefined behavior. - Add NULL check when unloading xm file.
This commit is contained in:
4
src/external/jar_xm.h
vendored
4
src/external/jar_xm.h
vendored
@ -696,7 +696,9 @@ int jar_xm_create_context_safe(jar_xm_context_t** ctxp, const char* moddata, siz
|
||||
}
|
||||
|
||||
void jar_xm_free_context(jar_xm_context_t* ctx) {
|
||||
JARXM_FREE(ctx->allocated_memory);
|
||||
if (ctx != NULL) {
|
||||
JARXM_FREE(ctx->allocated_memory);
|
||||
}
|
||||
}
|
||||
|
||||
void jar_xm_set_max_loop_count(jar_xm_context_t* ctx, uint8_t loopcnt) {
|
||||
|
||||
Reference in New Issue
Block a user