From 3ea8f70792b62c70bfcae97b970e3830d85c5d72 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 2 Sep 2008 13:11:54 +0000 Subject: [PATCH] Handle OSystem::lockScreen fail in default OSystem::clearScreen implementation. svn-id: r34276 --- common/system.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/system.cpp b/common/system.cpp index d0548cdd2d6..863f395671e 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -115,7 +115,8 @@ Common::EventManager *OSystem::getEventManager() { void OSystem::clearScreen() { Graphics::Surface *screen = lockScreen(); - memset(screen->pixels, 0, screen->h * screen->pitch); + if (screen && screen->pixels) + memset(screen->pixels, 0, screen->h * screen->pitch); unlockScreen(); }