aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorMarcus Comstedt2006-10-22 17:32:04 +0000
committerMarcus Comstedt2006-10-22 17:32:04 +0000
commit43fac9ab3da947e502e7abfeff74b5e4d536c219 (patch)
treef84356e2e9b64bf6caad11fad78e98416d9791e6 /backends
parent9cad1d4ae873a6ed5cceb7d282ee13f453fe9187 (diff)
downloadscummvm-rg350-43fac9ab3da947e502e7abfeff74b5e4d536c219.tar.gz
scummvm-rg350-43fac9ab3da947e502e7abfeff74b5e4d536c219.tar.bz2
scummvm-rg350-43fac9ab3da947e502e7abfeff74b5e4d536c219.zip
Check for degenerated rect in copyRectTo*.
svn-id: r24452
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/dc/display.cpp4
1 files changed, 4 insertions, 0 deletions
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));