Add missing bounds checks to ItemTextureQuadConverter (#4343)

This commit is contained in:
Ben Staddon 2017-09-06 22:08:19 +01:00 committed by LexManos
parent da85dcadf5
commit ef5ffc2c5d
1 changed files with 2 additions and 2 deletions

View File

@ -92,7 +92,7 @@ public final class ItemTextureQuadConverter
// if they are, we can extend the quad downwards
int endY = y + 1;
boolean sameRow = true;
while (sameRow)
while (sameRow && endY < h)
{
for (int i = 0; i < w; i++)
{
@ -166,7 +166,7 @@ public final class ItemTextureQuadConverter
// if they are, we can extend the quad downwards
int endX = x + 1;
boolean sameColumn = true;
while (sameColumn)
while (sameColumn && endX < w)
{
for (int i = 0; i < h; i++)
{