diff options
author | Gregory Montoir | 2005-08-10 22:13:55 +0000 |
---|---|---|
committer | Gregory Montoir | 2005-08-10 22:13:55 +0000 |
commit | d1a376ad279d2f64bb9029b1f429a807d8c9cdeb (patch) | |
tree | d134a859f1b423a9390453cab2bea7a2b3ebd838 | |
parent | 0af7371717f59199e2956d6643187de98235bede (diff) | |
download | scummvm-rg350-d1a376ad279d2f64bb9029b1f429a807d8c9cdeb.tar.gz scummvm-rg350-d1a376ad279d2f64bb9029b1f429a807d8c9cdeb.tar.bz2 scummvm-rg350-d1a376ad279d2f64bb9029b1f429a807d8c9cdeb.zip |
clip the 'top' argument in Gdi::resetBackground (as we do for bottom), this is safer and should prevent crashes when loading savegames with 'invalid' coordinates for the actors. See also bug #1252714.
svn-id: r18655
-rw-r--r-- | scumm/gfx.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 0a51aef884..fe692a0c7a 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -1727,7 +1727,10 @@ void Gdi::resetBackground(int top, int bottom, int strip) { byte *backbuff_ptr, *bgbak_ptr; int numLinesToProcess; - if (bottom >= vs->h) + if (top < 0) + top = 0; + + if (bottom > vs->h) bottom = vs->h; if (top >= bottom) |