diff options
author | Johannes Schickel | 2010-07-04 01:18:49 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-07-04 01:18:49 +0000 |
commit | 052d2ab6f17e6ec239f368ee802a659be46098cc (patch) | |
tree | 5a412b61ea3128dd4150fa4dfd0b10d899973b00 /gui | |
parent | 336cde4b61df758dd438c9633863d50f5442037c (diff) | |
download | scummvm-rg350-052d2ab6f17e6ec239f368ee802a659be46098cc.tar.gz scummvm-rg350-052d2ab6f17e6ec239f368ee802a659be46098cc.tar.bz2 scummvm-rg350-052d2ab6f17e6ec239f368ee802a659be46098cc.zip |
Prevent GraphicsWidget from being assigned a surface which wouldn't fit in the widget.
svn-id: r50641
Diffstat (limited to 'gui')
-rw-r--r-- | gui/widget.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp index 9297cce344..14cb61006b 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -583,6 +583,11 @@ void GraphicsWidget::setGfx(const Graphics::Surface *gfx) { if (!gfx || !gfx->pixels) return; + if (gfx->w > _w || gfx->h > _h) { + warning("GraphicsWidget has size %dx%d, but a surface with %dx%d is to be set", _w, _h, gfx->w, gfx->h); + return; + } + // TODO: add conversion to OverlayColor _gfx.copyFrom(*gfx); } |