This commit is contained in:
@@ -26,7 +26,7 @@ public class CommonBinaryParser extends ParserConstants {
|
||||
int[] stringsOffset = is.readInt32Array(stringCount);
|
||||
int[] stylesOffset = is.readInt32Array(styleCount);
|
||||
|
||||
is.checkPos(start + stringsStart, "Expected strings start");
|
||||
is.skipToPos(start + stringsStart, "Expected strings start");
|
||||
String[] strings = new String[stringCount];
|
||||
byte[] strData = is.readInt8Array((int) (chunkEnd - is.getPos()));
|
||||
if ((flags & UTF8_FLAG) != 0) {
|
||||
|
||||
@@ -127,6 +127,10 @@ public class ParserStream {
|
||||
|
||||
public void skipToPos(long expectedOffset, String error) throws IOException {
|
||||
long pos = getPos();
|
||||
if (pos > expectedOffset) {
|
||||
throw new IOException(error + ", expected offset not reachable: 0x" + Long.toHexString(expectedOffset)
|
||||
+ ", actual: 0x" + Long.toHexString(getPos()));
|
||||
}
|
||||
if (pos < expectedOffset) {
|
||||
skip(expectedOffset - pos);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user