restored a zero

This commit is contained in:
Denis Molony 2020-03-29 14:55:25 +10:00
parent 4eaf2338cb
commit 32d1b5d07e
2 changed files with 543 additions and 543 deletions

View File

@ -171,7 +171,7 @@ public class SHRPictureFile2 extends HiResImage
failureReason = "Buffer should be 38,400 bytes"; failureReason = "Buffer should be 38,400 bytes";
return; return;
} }
int maxTables = (buffer.length - 3200) / COLOR_TABLE_SIZE; int maxTables = (buffer.length - 32000) / COLOR_TABLE_SIZE;
colorTables = new ColorTable[maxTables]; colorTables = new ColorTable[maxTables];
for (int i = 0; i < colorTables.length; i++) for (int i = 0; i < colorTables.length; i++)
{ {

View File

@ -387,7 +387,7 @@ public class HexFormatter
{ {
if (ptr >= buffer.length) if (ptr >= buffer.length)
{ {
System.out.println ("index out of range: " + ptr); System.out.println ("Index out of range (unsigned short): " + ptr);
return 0; return 0;
} }
return (buffer[ptr] & 0xFF) | ((buffer[ptr + 1] & 0xFF) << 8); return (buffer[ptr] & 0xFF) | ((buffer[ptr + 1] & 0xFF) << 8);
@ -399,7 +399,7 @@ public class HexFormatter
{ {
if (ptr >= buffer.length) if (ptr >= buffer.length)
{ {
System.out.println ("index out of range: " + ptr); System.out.println ("Index out of range (signed short): " + ptr);
return 0; return 0;
} }
return (short) ((buffer[ptr] & 0xFF) | ((buffer[ptr + 1] & 0xFF) << 8)); return (short) ((buffer[ptr] & 0xFF) | ((buffer[ptr + 1] & 0xFF) << 8));