summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core.c6
-rw-r--r--src/rlgl.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/core.c b/src/core.c
index 6b3906e7..4734fe5b 100644
--- a/src/core.c
+++ b/src/core.c
@@ -2602,7 +2602,11 @@ unsigned char *DecompressData(unsigned char *compData, int compDataLength, int *
// Decompress data from a valid DEFLATE stream
data = RL_CALLOC(MAX_DECOMPRESSION_SIZE*1024*1024, 1);
int length = sinflate(data, compData, compDataLength);
- RL_REALLOC(data, length);
+ unsigned char *temp = RL_REALLOC(data, length);
+
+ if (temp != NULL) data = temp;
+ else TRACELOG(LOG_WARNING, "SYSTEM: Failed to re-allocate required decompression memory");
+
*dataLength = length;
TraceLog(LOG_INFO, "SYSTEM: Data compressed: Original size: %i -> Comp. size: %i\n", dataLength, compDataLength);
diff --git a/src/rlgl.h b/src/rlgl.h
index 3eec9e16..e279448d 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -4800,7 +4800,7 @@ static int GenerateMipmaps(unsigned char *data, int baseWidth, int baseHeight)
unsigned char *temp = RL_REALLOC(data, size);
if (temp != NULL) data = temp;
- else TRACELOG(LOG_WARNING, "TEXTURE: Failed to allocate required mipmaps memory");
+ else TRACELOG(LOG_WARNING, "TEXTURE: Failed to re-allocate required mipmaps memory");
width = baseWidth;
height = baseHeight;