fix(res): skip string if parsing failed (#712)

This commit is contained in:
Skylot
2019-07-14 17:06:19 +03:00
parent 0c2784bb42
commit 8e8a2faa10
@@ -11,7 +11,6 @@ public class CommonBinaryParser extends ParserConstants {
return parseStringPoolNoType();
}
@SuppressWarnings("unused")
protected String[] parseStringPoolNoType() throws IOException {
long start = is.getPos() - 2;
is.checkInt16(0x001c, "String pool header size not 0x001c");
@@ -56,6 +55,9 @@ public class CommonBinaryParser extends ParserConstants {
}
private static String extractString8(byte[] strArray, int offset) {
if (offset >= strArray.length) {
return "STRING_DECODE_ERROR";
}
int start = offset + skipStrLen8(strArray, offset);
int len = strArray[start++];
if (len == 0) {