From da893064a0f0cfa6513b71fda9079294c4929427 Mon Sep 17 00:00:00 2001 From: Steven Smith Date: Tue, 20 Jan 2015 20:58:56 -0800 Subject: [PATCH] Perform bounds checks on drawing. --- source/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/common.c b/source/common.c index 45c912d..3516caf 100644 --- a/source/common.c +++ b/source/common.c @@ -308,7 +308,7 @@ int screen_get_index(int x, int y) { } void screen_draw(int x, int y, u8 r, u8 g, u8 b) { - if(fb == NULL) { + if(fb == NULL || x < 0 || y < 0 || x >= screen_get_width() || y >= screen_get_height()) { return; }