From 43fac9ab3da947e502e7abfeff74b5e4d536c219 Mon Sep 17 00:00:00 2001 From: Marcus Comstedt Date: Sun, 22 Oct 2006 17:32:04 +0000 Subject: Check for degenerated rect in copyRectTo*. svn-id: r24452 --- backends/platform/dc/display.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'backends/platform') diff --git a/backends/platform/dc/display.cpp b/backends/platform/dc/display.cpp index 338138f912..7efe0fde93 100644 --- a/backends/platform/dc/display.cpp +++ b/backends/platform/dc/display.cpp @@ -237,6 +237,8 @@ void OSystem_Dreamcast::initSize(uint w, uint h) void OSystem_Dreamcast::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) { + if(w<1 || h<1) + return; unsigned char *dst = screen + y*SCREEN_W + x; do { memcpy(dst, buf, w); @@ -568,6 +570,8 @@ void OSystem_Dreamcast::grabOverlay(int16 *buf, int pitch) void OSystem_Dreamcast::copyRectToOverlay(const int16 *buf, int pitch, int x, int y, int w, int h) { + if(w<1 || h<1) + return; unsigned short *dst = overlay + y*OVL_W + x; do { memcpy(dst, buf, w*sizeof(int16)); -- cgit v1.2.3