summaryrefslogtreecommitdiffstats
path: root/media/libmedia
diff options
context:
space:
mode:
authorJessica Wagantall <jwagantall@cyngn.com>2016-11-09 11:51:30 -0800
committerJessica Wagantall <jwagantall@cyngn.com>2016-11-09 11:58:46 -0800
commit26c5fa31d17a638bf314de6e12e86bb8a86db44b (patch)
treebdc7f3eeafcd04c5194bec6e8f3f2892a52432a0 /media/libmedia
parent1c6e16c0b4082c0edaca4fcc0838f33bf14ffac8 (diff)
parentc13a507aa0badeb5f8482c25e2845780ba021ce7 (diff)
downloadframeworks_av-26c5fa31d17a638bf314de6e12e86bb8a86db44b.zip
frameworks_av-26c5fa31d17a638bf314de6e12e86bb8a86db44b.tar.gz
frameworks_av-26c5fa31d17a638bf314de6e12e86bb8a86db44b.tar.bz2
Merge tag 'android-6.0.1_r74' into HEAD
CYNGNOS-3303 Android 6.0.1 release 74 Change-Id: I0a14578751f4ecb8d13def26b9ffe5dcba4afd72
Diffstat (limited to 'media/libmedia')
-rw-r--r--media/libmedia/IDrm.cpp2
-rw-r--r--media/libmedia/IOMX.cpp66
2 files changed, 38 insertions, 30 deletions
diff --git a/media/libmedia/IDrm.cpp b/media/libmedia/IDrm.cpp
index 7c709cd..6f6530b 100644
--- a/media/libmedia/IDrm.cpp
+++ b/media/libmedia/IDrm.cpp
@@ -912,7 +912,7 @@ status_t BnDrm::onTransact(
readVector(data, keyId);
readVector(data, message);
readVector(data, signature);
- bool match;
+ bool match = false;
uint32_t result = verify(sessionId, keyId, message, signature, match);
reply->writeInt32(match);
reply->writeInt32(result);
diff --git a/media/libmedia/IOMX.cpp b/media/libmedia/IOMX.cpp
index ab2d179..7e951c9 100644
--- a/media/libmedia/IOMX.cpp
+++ b/media/libmedia/IOMX.cpp
@@ -249,7 +249,7 @@ public:
virtual status_t useBuffer(
node_id node, OMX_U32 port_index, const sp<IMemory> &params,
- buffer_id *buffer, OMX_U32 allottedSize) {
+ buffer_id *buffer, OMX_U32 allottedSize, OMX_BOOL /* crossProcess */) {
Parcel data, reply;
data.writeInterfaceToken(IOMX::getInterfaceDescriptor());
data.writeInt32((int32_t)node);
@@ -483,7 +483,7 @@ public:
virtual status_t allocateBufferWithBackup(
node_id node, OMX_U32 port_index, const sp<IMemory> &params,
- buffer_id *buffer, OMX_U32 allottedSize) {
+ buffer_id *buffer, OMX_U32 allottedSize, OMX_BOOL /* crossProcess */) {
Parcel data, reply;
data.writeInterfaceToken(IOMX::getInterfaceDescriptor());
data.writeInt32((int32_t)node);
@@ -735,31 +735,35 @@ status_t BnOMX::onTransact(
// mark the last page as inaccessible, to avoid exploitation
// of codecs that access past the end of the allocation because
// they didn't check the size
- mprotect((char*)params + allocSize - pageSize, pageSize, PROT_NONE);
- switch (code) {
- case GET_PARAMETER:
- err = getParameter(node, index, params, size);
- break;
- case SET_PARAMETER:
- err = setParameter(node, index, params, size);
- break;
- case GET_CONFIG:
- err = getConfig(node, index, params, size);
- break;
- case SET_CONFIG:
- err = setConfig(node, index, params, size);
- break;
- case SET_INTERNAL_OPTION:
- {
- InternalOptionType type =
- (InternalOptionType)data.readInt32();
-
- err = setInternalOption(node, index, type, params, size);
- break;
+ if (mprotect((char*)params + allocSize - pageSize, pageSize,
+ PROT_NONE) != 0) {
+ ALOGE("mprotect failed: %s", strerror(errno));
+ } else {
+ switch (code) {
+ case GET_PARAMETER:
+ err = getParameter(node, index, params, size);
+ break;
+ case SET_PARAMETER:
+ err = setParameter(node, index, params, size);
+ break;
+ case GET_CONFIG:
+ err = getConfig(node, index, params, size);
+ break;
+ case SET_CONFIG:
+ err = setConfig(node, index, params, size);
+ break;
+ case SET_INTERNAL_OPTION:
+ {
+ InternalOptionType type =
+ (InternalOptionType)data.readInt32();
+
+ err = setInternalOption(node, index, type, params, size);
+ break;
+ }
+
+ default:
+ TRESPASS();
}
-
- default:
- TRESPASS();
}
}
}
@@ -836,7 +840,8 @@ status_t BnOMX::onTransact(
OMX_U32 allottedSize = data.readInt32();
buffer_id buffer;
- status_t err = useBuffer(node, port_index, params, &buffer, allottedSize);
+ status_t err = useBuffer(
+ node, port_index, params, &buffer, allottedSize, OMX_TRUE /* crossProcess */);
reply->writeInt32(err);
if (err == OK) {
@@ -971,7 +976,10 @@ status_t BnOMX::onTransact(
OMX_BOOL enable = (OMX_BOOL)data.readInt32();
MetadataBufferType type = kMetadataBufferTypeInvalid;
- status_t err = storeMetaDataInBuffers(node, port_index, enable, &type);
+ status_t err =
+ // only control output metadata via Binder
+ port_index != 1 /* kOutputPortIndex */ ? BAD_VALUE :
+ storeMetaDataInBuffers(node, port_index, enable, &type);
reply->writeInt32(type);
reply->writeInt32(err);
@@ -1057,7 +1065,7 @@ status_t BnOMX::onTransact(
buffer_id buffer;
status_t err = allocateBufferWithBackup(
- node, port_index, params, &buffer, allottedSize);
+ node, port_index, params, &buffer, allottedSize, OMX_TRUE /* crossProcess */);
reply->writeInt32(err);