Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/external/stb_vorbis.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,13 +957,21 @@ static void *setup_malloc(vorb *f, int sz)
f->setup_offset += sz;
return p;
}
#ifdef STB_VORBIS_MALLOC
return sz ? STB_VORBIS_MALLOC(sz) : NULL;
#else
return sz ? malloc(sz) : NULL;
#endif
}

static void setup_free(vorb *f, void *p)
{
if (f->alloc.alloc_buffer) return; // do nothing; setup mem is a stack
#ifdef STB_VORBIS_FREE
STB_VORBIS_FREE(p);
#else
free(p);
#endif
}

static void *setup_temp_malloc(vorb *f, int sz)
Expand Down
3 changes: 2 additions & 1 deletion src/raudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ typedef struct tagBITMAPINFOHEADER {
#endif

#if SUPPORT_FILEFORMAT_OGG
// TODO: Remap stb_vorbis malloc()/free() calls to RL_MALLOC/RL_FREE
#define STB_VORBIS_MALLOC RL_MALLOC
#define STB_VORBIS_FREE RL_FREE
#include "external/stb_vorbis.c" // OGG loading functions
#endif

Expand Down
Loading