mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Client: Don't crash if trying to draw too many items from inventory in HUD
This commit is contained in:
parent
3a6d6e4751
commit
8d31534710
1 changed files with 1 additions and 1 deletions
|
@ -127,7 +127,7 @@ void Hud::drawItem(v2s32 upperleftpos, s32 imgsize, s32 itemcount,
|
|||
NULL, hbar_colors, true);
|
||||
}
|
||||
|
||||
for (s32 i = 0; i < itemcount; i++)
|
||||
for (s32 i = 0; i < itemcount && (size_t)i < mainlist->getSize(); i++)
|
||||
{
|
||||
const ItemStack &item = mainlist->getItem(i);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue