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);