summaryrefslogtreecommitdiffstats
path: root/media/libmedia
diff options
context:
space:
mode:
authormspector@google.com <mspector@google.com>2016-02-08 17:07:06 -0800
committerThe Android Automerger <android-build@google.com>2016-03-01 15:25:30 -0800
commit1a5ab71d6a43a53535f37648b09d22b741265bb2 (patch)
tree850076bbe76481cc3c7c0c27b6fea75f6d89d545 /media/libmedia
parent7227fe0eb793c3e9e313df7454862d360c9bd360 (diff)
downloadframeworks_av-1a5ab71d6a43a53535f37648b09d22b741265bb2.zip
frameworks_av-1a5ab71d6a43a53535f37648b09d22b741265bb2.tar.gz
frameworks_av-1a5ab71d6a43a53535f37648b09d22b741265bb2.tar.bz2
3 uninitialized variables in IOMX.cpp
Uninitialized MetadataBufferType pointer in case: SET_INPUT_SURFACE STORE_META_DATA_IN_BUFFERS CREATE_INPUT_SURFACE Fix: initialize them to kMetadataBufferTypeInvalid Bug: 26324358 Change-Id: Ib3bcac9bedc98bc65efa39f67cdbffbd90b374c9
Diffstat (limited to 'media/libmedia')
-rw-r--r--media/libmedia/IOMX.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/media/libmedia/IOMX.cpp b/media/libmedia/IOMX.cpp
index 8f55eb9..07f3697 100644
--- a/media/libmedia/IOMX.cpp
+++ b/media/libmedia/IOMX.cpp
@@ -844,9 +844,13 @@ status_t BnOMX::onTransact(
OMX_U32 port_index = data.readInt32();
sp<IGraphicBufferProducer> bufferProducer;
- MetadataBufferType type;
+ MetadataBufferType type = kMetadataBufferTypeInvalid;
status_t err = createInputSurface(node, port_index, &bufferProducer, &type);
+ if ((err != OK) && (type == kMetadataBufferTypeInvalid)) {
+ android_errorWriteLog(0x534e4554, "26324358");
+ }
+
reply->writeInt32(type);
reply->writeInt32(err);
@@ -886,9 +890,13 @@ status_t BnOMX::onTransact(
sp<IGraphicBufferConsumer> bufferConsumer =
interface_cast<IGraphicBufferConsumer>(data.readStrongBinder());
- MetadataBufferType type;
+ MetadataBufferType type = kMetadataBufferTypeInvalid;
status_t err = setInputSurface(node, port_index, bufferConsumer, &type);
+ if ((err != OK) && (type == kMetadataBufferTypeInvalid)) {
+ android_errorWriteLog(0x534e4554, "26324358");
+ }
+
reply->writeInt32(type);
reply->writeInt32(err);
return NO_ERROR;
@@ -914,8 +922,13 @@ status_t BnOMX::onTransact(
OMX_U32 port_index = data.readInt32();
OMX_BOOL enable = (OMX_BOOL)data.readInt32();
- MetadataBufferType type;
+ MetadataBufferType type = kMetadataBufferTypeInvalid;
status_t err = storeMetaDataInBuffers(node, port_index, enable, &type);
+
+ if ((err != OK) && (type == kMetadataBufferTypeInvalid)) {
+ android_errorWriteLog(0x534e4554, "26324358");
+ }
+
reply->writeInt32(type);
reply->writeInt32(err);