summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shape.c2
-rw-r--r--shape.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/shape.c b/shape.c
index f3150127ff..e7dd85c3f7 100644
--- a/shape.c
+++ b/shape.c
@@ -139,7 +139,7 @@ get_next_shape_internal(rb_shape_t * shape, ID id, enum shape_type shape_type, b
*variation_created = false;
- if (new_shapes_allowed) {
+ if (new_shapes_allowed && shape->next_iv_index < SHAPE_MAX_NUM_IVS) {
RB_VM_LOCK_ENTER();
{
bool had_edges = !!shape->edges;
diff --git a/shape.h b/shape.h
index 60084a4aff..df0e633073 100644
--- a/shape.h
+++ b/shape.h
@@ -31,6 +31,7 @@ typedef uint16_t shape_id_t;
# define SHAPE_BITMAP_SIZE 16384
# define SHAPE_MAX_VARIATIONS 8
+# define SHAPE_MAX_NUM_IVS 50
# define MAX_SHAPE_ID (SHAPE_MASK - 1)
# define INVALID_SHAPE_ID SHAPE_MASK