summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author MÃ¥rten Kongstad <marten.kongstad@sonymobile.com> 2014-11-07 10:56:12 +0100
committer Zoran Jovanovic <zoran.jovanovic@sonymobile.com> 2014-11-07 16:08:04 +0100
commit96198ebae8deab14b434645f628213db492abdbc (patch)
tree5bd198f05925adf0110976f10eb8805c41329d3b
parent30113131fb958850ef92c6a8f7f2aa2ed92a8ffe (diff)
RRO idmap: pad with 0xffffffff, not 0x00000000
In the new idmap format (version 0x1), 0x00000000 no longer represents a non-existing entry: 0xffffffff should be used instead. Bug: 17765434 Change-Id: If2c7e09feba2224eeafe88fd9230e6392d81b9a7
-rw-r--r--libs/androidfw/ResourceTypes.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 825071a61924..ebdd1676502f 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -6080,14 +6080,14 @@ 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.
- if (typeMap.entryMap.resize((entryIndex - typeMap.entryOffset) + 1) < 0) {
+ // pad with 0xffffffff's (indicating non-existing entries) before adding this entry
+ size_t index = typeMap.entryMap.size();
+ size_t numItems = entryIndex - (typeMap.entryOffset + index);
+ if (typeMap.entryMap.insertAt(0xffffffff, index, numItems) < 0) {
return NO_MEMORY;
}
- typeMap.entryMap.editTop() = Res_GETENTRY(overlayResID);
- } else {
- typeMap.entryMap.add(Res_GETENTRY(overlayResID));
}
+ typeMap.entryMap.add(Res_GETENTRY(overlayResID));
}
if (!typeMap.entryMap.isEmpty()) {