diff options
author | Chris Robinson <[email protected]> | 2010-12-01 02:00:41 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-12-01 02:00:41 -0800 |
commit | 8a52c44d15c88761971a5f826b4ac368ba8d1817 (patch) | |
tree | bd12bfd1d98df396475d2c0fcd258b82f4e0702c /OpenAL32/alBuffer.c | |
parent | e6e18732b55923caeddd04f7b427c2b94fd4346e (diff) |
Don'f fail if realloc returns NULL for 0 sizes
Diffstat (limited to 'OpenAL32/alBuffer.c')
-rw-r--r-- | OpenAL32/alBuffer.c | 4 |
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; |