diff options
author | Sven Hesse | 2009-06-13 22:35:22 +0000 |
---|---|---|
committer | Sven Hesse | 2009-06-13 22:35:22 +0000 |
commit | acb0de658018a6554c965b08fceff0ed2810aef7 (patch) | |
tree | 73b86e4fc070261ca13ec113502966c1f779a9cd /engines | |
parent | 7eaf013bbfe0bbf07e14aa6f5f7c25a75f1f621e (diff) | |
download | scummvm-rg350-acb0de658018a6554c965b08fceff0ed2810aef7.tar.gz scummvm-rg350-acb0de658018a6554c965b08fceff0ed2810aef7.tar.bz2 scummvm-rg350-acb0de658018a6554c965b08fceff0ed2810aef7.zip |
Warn when a sprite operation is to be performed on a nonexistent surface instead of crashing
svn-id: r41499
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/draw_v2.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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: |