mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
Client: Don't crash if trying to draw too many items from inventory in HUD
This commit is contained in:
@@ -127,7 +127,7 @@ void Hud::drawItem(v2s32 upperleftpos, s32 imgsize, s32 itemcount,
|
|||||||
NULL, hbar_colors, true);
|
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);
|
const ItemStack &item = mainlist->getItem(i);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user