summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryingying <yingying@codeaurora.org>2014-10-22 18:27:24 +0800
committerSteve Kondik <steve@cyngn.com>2014-11-08 14:17:19 -0800
commit7e2249ea8bf603ca8d1431ecc03ee514ea34e35b (patch)
treec68f94a262f6cc6cff86b0a78d4db9914004193e
parent06f26ddef936cc76ad41d65d11660c6d776ab56a (diff)
downloadandroid_frameworks_base-7e2249ea8bf603ca8d1431ecc03ee514ea34e35b.tar.gz
android_frameworks_base-7e2249ea8bf603ca8d1431ecc03ee514ea34e35b.tar.bz2
android_frameworks_base-7e2249ea8bf603ca8d1431ecc03ee514ea34e35b.zip
androidfw: Init the items which are not present in the idmap as 0xffffffff.
When creating the idmap, if the entry is not present in the idmap, need to init the item as 0xffffffff. Change-Id: Iae4a968599e97b29c8b1e1de6a6c1d2639ba240a
-rw-r--r--libs/androidfw/ResourceTypes.cpp7
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));