aboutsummaryrefslogtreecommitdiff
path: root/backends/sdl
diff options
context:
space:
mode:
authorMax Horn2005-11-08 22:23:09 +0000
committerMax Horn2005-11-08 22:23:09 +0000
commit3cc22c638c12e2a0b49a841948468e37733e4817 (patch)
tree55e198b37c4ffbc55e727dbddb8bbdcaac3e2650 /backends/sdl
parent5f32a2c3b60a2ad08de417a01a56074134d573d9 (diff)
downloadscummvm-rg350-3cc22c638c12e2a0b49a841948468e37733e4817.tar.gz
scummvm-rg350-3cc22c638c12e2a0b49a841948468e37733e4817.tar.bz2
scummvm-rg350-3cc22c638c12e2a0b49a841948468e37733e4817.zip
Added asserts to OSystem_SDL::copyRectToScreen, which should detect any attempts to use invalid rects for blitting
svn-id: r19521
Diffstat (limited to 'backends/sdl')
-rw-r--r--backends/sdl/graphics.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/backends/sdl/graphics.cpp b/backends/sdl/graphics.cpp
index 7215f12a81..865c96fa37 100644
--- a/backends/sdl/graphics.cpp
+++ b/backends/sdl/graphics.cpp
@@ -802,6 +802,11 @@ void OSystem_SDL::copyRectToScreen(const byte *src, int pitch, int x, int y, int
Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends
+ assert(x >= 0 && x < _screenWidth);
+ assert(y >= 0 && y < _screenHeight);
+ assert(h > 0 && y + h <= _screenHeight);
+ assert(w > 0 && x + w <= _screenWidth);
+
if (((long)src & 3) == 0 && pitch == _screenWidth && x == 0 && y == 0 &&
w == _screenWidth && h == _screenHeight && _modeFlags & DF_WANT_RECT_OPTIM) {
/* Special, optimized case for full screen updates.