Skip to content

Commit

Permalink
omx: prevent input port enable/disable for software codecs
Browse files Browse the repository at this point in the history
Bug: 29421804
Change-Id: Iba1011e9af942a6dff7f659af769a51e3f5ba66f
(cherry picked from commit 2b94fa8)
  • Loading branch information
Wonsik Kim authored and andi34 committed Oct 22, 2016
1 parent 78c5bc5 commit 013273d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions media/libstagefright/omx/SimpleSoftOMXComponent.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 013273d

Please sign in to comment.