summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorWonsik Kim <wonsik@google.com>2016-07-07 12:57:02 +0900
committergitbuildkicker <android-build@google.com>2016-07-21 17:29:25 -0700
commitc174665ec2f19904550daeb65d08f4959654d9a4 (patch)
treee4c7e0303b32b8d609177ad668dd1416633b775e /media/libstagefright
parentd67bab69a322990aa386dad608ad2a823ef21578 (diff)
downloadframeworks_av-c174665ec2f19904550daeb65d08f4959654d9a4.zip
frameworks_av-c174665ec2f19904550daeb65d08f4959654d9a4.tar.gz
frameworks_av-c174665ec2f19904550daeb65d08f4959654d9a4.tar.bz2
omx: prevent input port enable/disable for software codecs
Bug: 29421804 Change-Id: Iba1011e9af942a6dff7f659af769a51e3f5ba66f
Diffstat (limited to 'media/libstagefright')
-rw-r--r--media/libstagefright/omx/SimpleSoftOMXComponent.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/media/libstagefright/omx/SimpleSoftOMXComponent.cpp b/media/libstagefright/omx/SimpleSoftOMXComponent.cpp
index 60c1e2e..13afd45 100644
--- a/media/libstagefright/omx/SimpleSoftOMXComponent.cpp
+++ b/media/libstagefright/omx/SimpleSoftOMXComponent.cpp
@@ -469,6 +469,13 @@ void SimpleSoftOMXComponent::onPortEnable(OMX_U32 portIndex, bool enable) {
CHECK_EQ((int)port->mTransition, (int)PortInfo::NONE);
CHECK(port->mDef.bEnabled == !enable);
+ if (port->mDef.eDir != OMX_DirOutput) {
+ ALOGE("Port enable/disable allowed only on output ports.");
+ notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
+ android_errorWriteLog(0x534e4554, "29421804");
+ return;
+ }
+
if (!enable) {
port->mDef.bEnabled = OMX_FALSE;
port->mTransition = PortInfo::DISABLING;