From a4ff4d37a40b60ce7f7029c6fe12181c0e1e89e5 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 7 Oct 2009 12:46:43 +0100 Subject: [PATCH] [clutter-id-pool] Fix the check for out-of-range IDs If id == the length of the array then it is also invalid and could cause a crash. --- clutter/clutter-id-pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clutter/clutter-id-pool.c b/clutter/clutter-id-pool.c index 53c7c6711..c5ecc5949 100644 --- a/clutter/clutter-id-pool.c +++ b/clutter/clutter-id-pool.c @@ -115,7 +115,7 @@ clutter_id_pool_lookup (ClutterIDPool *id_pool, g_return_val_if_fail (id_pool != NULL, NULL); g_return_val_if_fail (id_pool->array != NULL, NULL); - if (id > id_pool->array->len) + if (id >= id_pool->array->len) { g_warning ("The required ID of %u is outside the ID range; this " "usually implies that the pick() of an actor is not "