aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-04-07 09:49:06 -0700
committerChris Robinson <[email protected]>2017-04-07 09:49:06 -0700
commit7fd88086f67c6dd1fd006178c9d1a3457837ccd3 (patch)
tree15b44945155e276600e1b7026697541e94b1d515
parent8f2e4d46ec2de3c813438c363919a3da6aab7a4f (diff)
Make sure malloc succeeded for 'delays'
-rw-r--r--Alc/hrtf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Alc/hrtf.c b/Alc/hrtf.c
index 0fbd34ee..577946d8 100644
--- a/Alc/hrtf.c
+++ b/Alc/hrtf.c
@@ -419,7 +419,7 @@ static struct Hrtf *LoadHrtf00(const ALubyte *data, size_t datalen, const char *
{
coeffs = malloc(sizeof(coeffs[0])*irSize*irCount);
delays = malloc(sizeof(delays[0])*irCount);
- if(coeffs == NULL)
+ if(coeffs == NULL || delays == NULL)
{
ERR("Out of memory.\n");
failed = AL_TRUE;
@@ -583,7 +583,7 @@ static struct Hrtf *LoadHrtf01(const ALubyte *data, size_t datalen, const char *
coeffs = malloc(sizeof(coeffs[0])*irSize*irCount);
delays = malloc(sizeof(delays[0])*irCount);
- if(coeffs == NULL)
+ if(coeffs == NULL || delays == NULL)
{
ERR("Out of memory.\n");
failed = AL_TRUE;