aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-07-01 23:32:06 -0700
committerChris Robinson <[email protected]>2014-07-01 23:32:06 -0700
commit5303ee25886116d78854374e16e16456741655bf (patch)
tree9130e4a70c1f04247424b7a02608f9252960e019
parentcb726d87cebaec50531e6b2e326bede178bb2065 (diff)
Avoid an undefined allocation of 0 bytes
-rw-r--r--utils/makehrtf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/makehrtf.c b/utils/makehrtf.c
index 7c836b33..b6d269bb 100644
--- a/utils/makehrtf.c
+++ b/utils/makehrtf.c
@@ -771,10 +771,11 @@ static int HpTpdfDither (const double in, int * hpHist) {
}
// Allocates an array of doubles.
-static double *CreateArray(const size_t n)
+static double *CreateArray(size_t n)
{
double *a;
+ if(n == 0) n = 1;
a = calloc(n, sizeof(double));
if(a == NULL)
{