diff --git a/src/Audio.c b/src/Audio.c index 69024ccce..b75f29de5 100644 --- a/src/Audio.c +++ b/src/Audio.c @@ -767,7 +767,9 @@ static cc_result Music_PlayOgg(struct Stream* source) { /* so we may end up decoding slightly over a second of audio */ chunkSize = fmt.channels * (fmt.sampleRate + vorbis.blockSizes[1]); samplesPerSecond = fmt.channels * fmt.sampleRate; - data = (cc_int16*)Mem_Alloc(chunkSize * AUDIO_MAX_BUFFERS, 2, "Ogg final output"); + + data = (cc_int16*)Mem_TryAlloc(chunkSize * AUDIO_MAX_BUFFERS, 2); + if (!data) { res = ERR_OUT_OF_MEMORY; goto cleanup; } /* fill up with some samples before playing */ for (i = 0; i < AUDIO_MAX_BUFFERS && !res; i++) { diff --git a/src/Drawer2D.c b/src/Drawer2D.c index 86d287580..d8faba31d 100644 --- a/src/Drawer2D.c +++ b/src/Drawer2D.c @@ -875,7 +875,7 @@ static cc_result SysFont_Init(const String* path, struct SysFont* font, FT_Open_ static void* FT_AllocWrapper(FT_Memory memory, long size) { return Mem_TryAlloc(size, 1); } static void FT_FreeWrapper(FT_Memory memory, void* block) { Mem_Free(block); } static void* FT_ReallocWrapper(FT_Memory memory, long cur_size, long new_size, void* block) { - return Mem_Realloc(block, new_size, 1, "Freetype data"); + return Mem_TryRealloc(block, new_size, 1); } static cc_bool updatedSysFonts; diff --git a/src/Graphics.h b/src/Graphics.h index 03e80976a..341d1141b 100644 --- a/src/Graphics.h +++ b/src/Graphics.h @@ -1,6 +1,5 @@ #ifndef CC_GFXAPI_H #define CC_GFXAPI_H -#include "PackedCol.h" #include "Vectors.h" #include "GameStructs.h" #include "Bitmap.h"