From 78fcc9847a9db6d42c8c263154ec05903a370b6b Mon Sep 17 00:00:00 2001 From: Jemma Issroff Date: Wed, 25 Jan 2023 13:45:32 -0500 Subject: Limit maximum number of IVs on a shape Create SHAPE_MAX_NUM_IVS (currently 50) and limit all shapes to that number of IVs. When a shape has more than 50 IVs, fallback to the obj_too_complex shape which uses hash lookup for ivs. --- shape.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shape.c') 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; -- cgit v1.2.1