Adapt AXMLResourceParser to handle broken headers.

Fixes #1976.
This commit is contained in:
Sebastian Rasmussen
2019-01-08 21:16:46 +01:00
parent 261e163bc9
commit b01dce7f3a
2 changed files with 5 additions and 5 deletions

View File

@ -42,11 +42,11 @@ public class ExtDataInput extends DataInputDelegate {
skipBytes(4);
}
public void skipCheckInt(int expected) throws IOException {
public void skipCheckInt(int expected1, int expected2) throws IOException {
int got = readInt();
if (got != expected) {
if (got != expected1 && got != expected2) {
throw new IOException(String.format(
"Expected: 0x%08x, got: 0x%08x", expected, got));
"Expected: 0x%08x or 0x%08x, got: 0x%08x", expected1, expected2, got));
}
}