diff --git a/src/ivfutils.c b/src/ivfutils.c index 690bea9..02e0839 100644 --- a/src/ivfutils.c +++ b/src/ivfutils.c @@ -25,8 +25,8 @@ VectorArrayInit(int maxlen, int dimensions, Size itemsize) { VectorArray res; - if (maxlen < 1 || dimensions < 1) - elog(ERROR, "safety check failed"); + if (maxlen < 1 || dimensions < 1 || itemsize == 0) + elog(ERROR, "cannot create vector array"); /* Ensure items are aligned to prevent UB */ itemsize = MAXALIGN(itemsize);