Fix seg faul when parsing invalid <plurals>

If the inner element of a <plurals> tag fails to parse, aapt2 will seg
fault. Don't do that.

Bug: 123423125
Test: manual
Change-Id: Iff39fa84073da62d85279683ac3d03b7309bc5e3
This commit is contained in:
Ryan Mitchell
2019-02-15 16:02:09 -08:00
parent 01d1fd33b7
commit 2f9077dfbb

View File

@@ -1623,7 +1623,9 @@ bool ResourceParser::ParsePlural(xml::XmlPullParser* parser,
if (!(plural->values[index] = ParseXml(
parser, android::ResTable_map::TYPE_STRING, kNoRawString))) {
error = true;
continue;
}
plural->values[index]->SetSource(item_source);
} else if (!ShouldIgnoreElement(element_namespace, element_name)) {