aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-12-01 02:00:41 -0800
committerChris Robinson <[email protected]>2010-12-01 02:00:41 -0800
commit8a52c44d15c88761971a5f826b4ac368ba8d1817 (patch)
treebd12bfd1d98df396475d2c0fcd258b82f4e0702c
parente6e18732b55923caeddd04f7b427c2b94fd4346e (diff)
Don'f fail if realloc returns NULL for 0 sizes
-rw-r--r--OpenAL32/alBuffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index 048f795c..3cde5698 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -1381,7 +1381,7 @@ static ALenum LoadData(ALbuffer *ALBuf, ALuint freq, ALenum NewFormat, ALsizei s
return AL_OUT_OF_MEMORY;
temp = realloc(ALBuf->data, newsize);
- if(!temp) return AL_OUT_OF_MEMORY;
+ if(!temp && newsize) return AL_OUT_OF_MEMORY;
ALBuf->data = temp;
ALBuf->size = newsize;
@@ -1408,7 +1408,7 @@ static ALenum LoadData(ALbuffer *ALBuf, ALuint freq, ALenum NewFormat, ALsizei s
return AL_OUT_OF_MEMORY;
temp = realloc(ALBuf->data, newsize);
- if(!temp) return AL_OUT_OF_MEMORY;
+ if(!temp && newsize) return AL_OUT_OF_MEMORY;
ALBuf->data = temp;
ALBuf->size = newsize;