mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +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 y = 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);
|
||||
}
|
||||
}
|
||||
|
||||
in.close();
|
||||
return t;
|
||||
|
Loading…
x
Reference in New Issue
Block a user