Skip to content

Commit 013273d

Browse files
Wonsik Kimandi34
authored andcommitted
omx: prevent input port enable/disable for software codecs
Bug: 29421804 Change-Id: Iba1011e9af942a6dff7f659af769a51e3f5ba66f (cherry picked from commit 2b94fa8)
1 parent 78c5bc5 commit 013273d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

media/libstagefright/omx/SimpleSoftOMXComponent.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,13 @@ void SimpleSoftOMXComponent::onPortEnable(OMX_U32 portIndex, bool enable) {
469469
CHECK_EQ((int)port->mTransition, (int)PortInfo::NONE);
470470
CHECK(port->mDef.bEnabled == !enable);
471471

472+
if (port->mDef.eDir != OMX_DirOutput) {
473+
ALOGE("Port enable/disable allowed only on output ports.");
474+
notify(OMX_EventError, OMX_ErrorUndefined, 0, NULL);
475+
android_errorWriteLog(0x534e4554, "29421804");
476+
return;
477+
}
478+
472479
if (!enable) {
473480
port->mDef.bEnabled = OMX_FALSE;
474481
port->mTransition = PortInfo::DISABLING;

0 commit comments

Comments
 (0)