From b63a28e5ad28aa1c9d56675992cdcdc2a0a09fbe Mon Sep 17 00:00:00 2001 From: Nunuhara Cabbage Date: Thu, 21 Nov 2019 21:51:04 -0800 Subject: [PATCH] Fix bug in sact_get_sprite --- sact_graphics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sact_graphics.c b/sact_graphics.c index 38876e6..0483aca 100644 --- a/sact_graphics.c +++ b/sact_graphics.c @@ -28,7 +28,7 @@ TAILQ_HEAD(listhead, sact_sprite) sprite_list = struct sact_sprite *sact_get_sprite(int sp) { - if (sp >= nr_sprites) + if (sp < 0 || sp >= nr_sprites) return NULL; return sprites[sp]; }