aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2012-10-18 15:53:16 -0700
committerStephen Hines <srhines@google.com>2012-10-18 15:53:16 -0700
commit6f3138bbc93b7105ddb49a803c15c3f98077f533 (patch)
tree1113a20380f680f8185ec38f477b6e5c904a8f98
parent0d6d592c5c0d28331151e6c4b7fb7d0789b99974 (diff)
downloadlibbcc-jb-mr1-release.tar.gz
The refactored version for metadata extraction skipped actually populating the mObjectSlots list. This can result in memory leaks in libRS, as well as having the potential for corruption (since we are now returning an empty list to a driver that expects legitimate boolean values). Bug: 7377851 Change-Id: Id67d46232eeb6b1f59904037b0504a5c590874ee
-rw-r--r--lib/Renderscript/RSInfoExtractor.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Renderscript/RSInfoExtractor.cpp b/lib/Renderscript/RSInfoExtractor.cpp
index 3392982..4ba5703 100644
--- a/lib/Renderscript/RSInfoExtractor.cpp
+++ b/lib/Renderscript/RSInfoExtractor.cpp
@@ -338,6 +338,9 @@ RSInfo *RSInfo::ExtractFromSource(const Source &pSource,
//===--------------------------------------------------------------------===//
if (object_slots != NULL) {
llvm::MDNode *node;
+ for (unsigned int i = 0; i <= export_var->getNumOperands(); i++) {
+ result->mObjectSlots.push(0);
+ }
FOR_EACH_NODE_IN(object_slots, node) {
llvm::StringRef val = getStringFromOperand(node->getOperand(0));
if (val.empty()) {
@@ -349,6 +352,8 @@ RSInfo *RSInfo::ExtractFromSource(const Source &pSource,
ALOGE("Non-integer object slot value '%s' in %s!", val.str().c_str(),
module.getModuleIdentifier().c_str());
goto bail;
+ } else {
+ result->mObjectSlots.editItemAt(slot) = 1;
}
}
}