aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorJohannes Schickel2006-06-21 21:35:40 +0000
committerJohannes Schickel2006-06-21 21:35:40 +0000
commit034676f33a191a784104875ab689f30332757f5c (patch)
treea22c11e145dc93a5e0ce9ee79ce7e3e027e5aedd /gui
parent3b56fa4068696fccecc8bd694c99528c0c04de00 (diff)
downloadscummvm-rg350-034676f33a191a784104875ab689f30332757f5c.tar.gz
scummvm-rg350-034676f33a191a784104875ab689f30332757f5c.tar.bz2
scummvm-rg350-034676f33a191a784104875ab689f30332757f5c.zip
Commits fix for crashing about dialog mentioned my Marucs on -devel.
svn-id: r23248
Diffstat (limited to 'gui')
-rw-r--r--gui/ThemeClassic.cpp3
-rw-r--r--gui/ThemeNew.cpp4
2 files changed, 7 insertions, 0 deletions
diff --git a/gui/ThemeClassic.cpp b/gui/ThemeClassic.cpp
index 9c36463fd2..ecdb882f1f 100644
--- a/gui/ThemeClassic.cpp
+++ b/gui/ThemeClassic.cpp
@@ -166,6 +166,9 @@ void ThemeClassic::drawText(const Common::Rect &r, const Common::String &str, St
if (!_initOk)
return;
+ if (r.top < 0 || r.bottom - _font->getFontHeight() >= _screen.h)
+ return;
+
if (!inverted) {
restoreBackground(r);
_font->drawString(&_screen, str, r.left, r.top, r.width(), getColor(state), convertAligment(align), deltax, useEllipsis);
diff --git a/gui/ThemeNew.cpp b/gui/ThemeNew.cpp
index 1b8b15b9f8..5c87554690 100644
--- a/gui/ThemeNew.cpp
+++ b/gui/ThemeNew.cpp
@@ -303,6 +303,10 @@ void ThemeNew::drawDialogBackground(const Common::Rect &r, uint16 hints, State s
void ThemeNew::drawText(const Common::Rect &r, const Common::String &str, State state, TextAlign align, bool inverted, int deltax, bool useEllipsis, FontStyle font) {
if (!_initOk)
return;
+
+ if (r.top < 0 || r.bottom - getFontHeight(font) >= _screen.h)
+ return;
+
Common::Rect r2(r.left, r.top, r.right, r.top+getFontHeight(font));
uint32 color;