From 9d1b6da0d1a8ff0c23c1fdaa2db41039037e405b Mon Sep 17 00:00:00 2001 From: OmniBlade Date: Thu, 13 Jun 2024 23:06:07 +0100 Subject: [PATCH] Fix under by one error in FillRect on SDL driver. --- common/video_sdl1.cpp | 2 +- common/video_sdl2.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/video_sdl1.cpp b/common/video_sdl1.cpp index f9440cbd..1c190682 100644 --- a/common/video_sdl1.cpp +++ b/common/video_sdl1.cpp @@ -457,7 +457,7 @@ class VideoSurfaceSDL1 : public VideoSurface virtual void FillRect(const Rect& rect, unsigned char color) { - SDL_Rect rectSDL = {rect.X, rect.Y, rect.Width, rect.Height}; + SDL_Rect rectSDL = {rect.X, rect.Y, rect.Width + 1, rect.Height + 1}; SDL_FillRect(surface, &rectSDL, color); } diff --git a/common/video_sdl2.cpp b/common/video_sdl2.cpp index b84f7436..e5ca8aac 100644 --- a/common/video_sdl2.cpp +++ b/common/video_sdl2.cpp @@ -790,7 +790,8 @@ class VideoSurfaceSDL2 : public VideoSurface virtual void FillRect(const Rect& rect, unsigned char color) { - SDL_FillRect(surface, (SDL_Rect*)(&rect), color); + SDL_Rect rectSDL = {rect.X, rect.Y, rect.Width + 1, rect.Height + 1}; + SDL_FillRect(surface, &rectSDL, color); } void RenderSurface()