From 3cc22c638c12e2a0b49a841948468e37733e4817 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 8 Nov 2005 22:23:09 +0000 Subject: Added asserts to OSystem_SDL::copyRectToScreen, which should detect any attempts to use invalid rects for blitting svn-id: r19521 --- backends/sdl/graphics.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'backends/sdl') 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. -- cgit v1.2.3