Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Client: Don't crash if trying to draw too many items from inventory i…
…n HUD
  • Loading branch information
celeron55 committed Apr 27, 2014
1 parent 3a6d6e4 commit 8d31534
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hud.cpp
Expand Up @@ -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);

Expand Down

0 comments on commit 8d31534

Please sign in to comment.