diff --git a/components/rtgui/common/dc_buffer.c b/components/rtgui/common/dc_buffer.c index 40da901bd0df81edefc28e4b3139c698afbffb6a..53cc07d959ad6d03a464b6b2d0f94d5bd5c38a64 100644 --- a/components/rtgui/common/dc_buffer.c +++ b/components/rtgui/common/dc_buffer.c @@ -134,6 +134,9 @@ static void rtgui_dc_buffer_draw_point(struct rtgui_dc* self, int x, int y) dc = (struct rtgui_dc_buffer*)self; + /* does not draw point out of dc */ + if ((x > dc->width) || (y > dc->height)) return ; + /* note: there is no parameter check in this function */ ptr = (rtgui_color_t*)(dc->pixel + y * dc->pitch + x * sizeof(rtgui_color_t));