aboutsummaryrefslogtreecommitdiff
path: root/engines/director
diff options
context:
space:
mode:
authorEugene Sandulenko2017-02-22 15:55:06 +0100
committerEugene Sandulenko2017-02-22 15:55:06 +0100
commitc03ee226ae32ae0dd60a4e6c7b551fdbb236bf2a (patch)
treefb152d0838e570bf74cd033e2ea16e5136f89a73 /engines/director
parent4cdb198f7898075f2cd2ed47067300a89a51d853 (diff)
downloadscummvm-rg350-c03ee226ae32ae0dd60a4e6c7b551fdbb236bf2a.tar.gz
scummvm-rg350-c03ee226ae32ae0dd60a4e6c7b551fdbb236bf2a.tar.bz2
scummvm-rg350-c03ee226ae32ae0dd60a4e6c7b551fdbb236bf2a.zip
DIRECTOR: Added sanity check when drawing text
Diffstat (limited to 'engines/director')
-rw-r--r--engines/director/frame.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 3c73b82af1..d20026cb62 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -915,6 +915,11 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
// textCast->fontId = _vm->_wm->_fontMan->getFontIdByName(_vm->getCurrentScore()->_fontMap[textCast->fontId]);
}
+ if (width == 0 || height == 0) {
+ warning("renderText: Requested to draw on an empty surface: %d x %d", width, height);
+ return;
+ }
+
Graphics::MacFont macFont = Graphics::MacFont(textCast->fontId, textCast->fontSize, textCast->textSlant);
const Graphics::Font *font = _vm->_wm->_fontMan->getFont(macFont);