From b04617007dd39ea192fc2160dc1dfb59310153c6 Mon Sep 17 00:00:00 2001 From: Federico Amedeo Izzo Date: Thu, 22 Oct 2020 17:29:32 +0200 Subject: [PATCH] graphics_rgb565.c Fixed screen size check --- openrtx/src/graphics/graphics_rgb565.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrtx/src/graphics/graphics_rgb565.c b/openrtx/src/graphics/graphics_rgb565.c index ab050609..31c2cb9e 100644 --- a/openrtx/src/graphics/graphics_rgb565.c +++ b/openrtx/src/graphics/graphics_rgb565.c @@ -121,7 +121,7 @@ void gfx_fillScreen(color_t color) void gfx_setPixel(point_t pos, color_t color) { - if (pos.x > screen_width || pos.y > screen_height) + if (pos.x >= screen_width || pos.y >= screen_height) return; // off the screen buf[pos.x + pos.y*screen_width] = _true2highColor(color);