From acb0de658018a6554c965b08fceff0ed2810aef7 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sat, 13 Jun 2009 22:35:22 +0000 Subject: Warn when a sprite operation is to be performed on a nonexistent surface instead of crashing svn-id: r41499 --- engines/gob/draw_v2.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines') diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp index 40ae45a1f8..86b8794f1c 100644 --- a/engines/gob/draw_v2.cpp +++ b/engines/gob/draw_v2.cpp @@ -705,6 +705,11 @@ void Draw_v2::spriteOperation(int16 operation) { sourceSurf = _spritesArray[_sourceSurface]; destSurf = _spritesArray[_destSurface]; + if (!destSurf) { + warning("Can't do operation %d on surface %d: nonexistent", operation, _destSurface); + return; + } + switch (operation) { case DRAW_BLITSURF: case DRAW_DRAWLETTER: -- cgit v1.2.3