diff options
-rw-r--r-- | libs/androidfw/ResourceTypes.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp index b5d2885e3f3..92e34d87be7 100644 --- a/libs/androidfw/ResourceTypes.cpp +++ b/libs/androidfw/ResourceTypes.cpp @@ -6081,9 +6081,16 @@ status_t ResTable::createIdmap(const ResTable& overlay, if (typeMap.entryOffset + typeMap.entryMap.size() < entryIndex) { // Resize to accomodate this entry and the 0's in between. + const size_t oldSize = typeMap.entryMap.size(); if (typeMap.entryMap.resize((entryIndex - typeMap.entryOffset) + 1) < 0) { return NO_MEMORY; } + const size_t newSize = typeMap.entryMap.size(); + for (size_t i = oldSize; i < newSize; ++i) { + // As this entry is not present in this idmap, so init the item as 0xffffffff. + // Please refer to the function IdmapEntries.lookup(). + typeMap.entryMap.editItemAt(i) = 0xffffffff; + } typeMap.entryMap.editTop() = Res_GETENTRY(overlayResID); } else { typeMap.entryMap.add(Res_GETENTRY(overlayResID)); |