mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-02 15:16:46 +00:00
Prevent GraphicsWidget from being assigned a surface which wouldn't fit in the widget.
svn-id: r50641
This commit is contained in:
parent
336cde4b61
commit
052d2ab6f1
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user