From 4b6b456a0633dd259ef72e26bd6afa89e712df7b Mon Sep 17 00:00:00 2001 From: bdemsky Date: Mon, 10 Jul 2017 17:24:15 -0700 Subject: [PATCH] Fix memory allocation error --- src/Encoders/elementencoding.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Encoders/elementencoding.c b/src/Encoders/elementencoding.c index 6ed38c2..a5158ab 100644 --- a/src/Encoders/elementencoding.c +++ b/src/Encoders/elementencoding.c @@ -29,7 +29,8 @@ void allocEncodingArrayElement(ElementEncoding *This, uint size) { } void allocInUseArrayElement(ElementEncoding *This, uint size) { - This->inUseArray=ourcalloc(1, size >> 6); + uint bytes = ((size + ((1 << 9)-1)) >> 6)&~7;//Depends on size of inUseArray + This->inUseArray=ourcalloc(1, bytes); } void allocElementConstraintVariables(ElementEncoding* This, uint numVars){ -- 2.34.1