mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 21:59:17 +00:00
AGS: Common: fail early in negative index
from upstream 4d9f1788059b2fdadd3e957a5a260a918458595d
This commit is contained in:
parent
5ad85c6b42
commit
a32892578a
@ -108,7 +108,7 @@ Rect GUIButton::CalcGraphicRect(bool clipped) {
|
||||
if (IsClippingImage())
|
||||
return rc;
|
||||
// Main button graphic
|
||||
if (_GP(spriteset)[CurrentImage] != nullptr)
|
||||
if (CurrentImage >= 0 && _GP(spriteset)[CurrentImage] != nullptr)
|
||||
rc = SumRects(rc, RectWH(0, 0, get_adjusted_spritewidth(CurrentImage), get_adjusted_spriteheight(CurrentImage)));
|
||||
// Optionally merge with the inventory pic
|
||||
if (_placeholder != kButtonPlace_None && _G(gui_inv_pic) >= 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user