mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Fix IOOB Exception
This commit is contained in:
parent
73360bb66c
commit
e73534ba2f
@ -66,15 +66,19 @@ public abstract class PaletteHunkIOAdapter<T> implements HunkIOAdapter<T> {
|
|||||||
int x = din.readShort() - Short.MIN_VALUE;
|
int x = din.readShort() - Short.MIN_VALUE;
|
||||||
int y = din.readShort() - Short.MIN_VALUE;
|
int y = din.readShort() - Short.MIN_VALUE;
|
||||||
int z = din.readShort() - Short.MIN_VALUE;
|
int z = din.readShort() - Short.MIN_VALUE;
|
||||||
T v = palette.getPalette().get(din.readShort() - Short.MIN_VALUE);
|
int vf = din.readShort() - Short.MIN_VALUE;
|
||||||
|
|
||||||
if(v == null)
|
T v = null;
|
||||||
|
if( palette.getPalette().hasIndex(vf))
|
||||||
{
|
{
|
||||||
throw new IOException("NULL VALUE AT " + x + " " + y + " " + z);
|
v = palette.getPalette().get(vf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(v != null)
|
||||||
|
{
|
||||||
t.setRaw(x,y,z, v);
|
t.setRaw(x,y,z, v);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
in.close();
|
in.close();
|
||||||
return t;
|
return t;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user