From: florianf Date: Sat, 30 Jan 2010 09:17:20 +0000 (+0000) Subject: src/video/sdl_renderer.cpp: Work around a segmentation fault in SDL. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0fec99a69347c8a7854e6fd787bfc5fb9561d05e;p=supertux.git src/video/sdl_renderer.cpp: Work around a segmentation fault in SDL. This closes bug #512. git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6283 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- diff --git a/src/video/sdl/sdl_renderer.cpp b/src/video/sdl/sdl_renderer.cpp index 6d6a357a5..39e8860f8 100644 --- a/src/video/sdl/sdl_renderer.cpp +++ b/src/video/sdl/sdl_renderer.cpp @@ -370,6 +370,9 @@ SDLRenderer::draw_filled_rect(const DrawingRequest& request) rect.y = (Sint16)request.pos.y * screen->h / SCREEN_HEIGHT; rect.w = (Uint16)fillrectrequest->size.x * screen->w / SCREEN_WIDTH; rect.h = (Uint16)fillrectrequest->size.y * screen->h / SCREEN_HEIGHT; + if((rect.w == 0) || (rect.h == 0)) { + return; + } Uint8 r = static_cast(fillrectrequest->color.red * 255); Uint8 g = static_cast(fillrectrequest->color.green * 255); Uint8 b = static_cast(fillrectrequest->color.blue * 255);