[vlc-devel] [PATCH] iomx: fix mediaserver crash with QCOM devices.
Thomas Guillem
guillem at archos.com
Thu Jul 3 17:11:59 CEST 2014
Some QCOM OMX_getParameter implementations override the nSize element to a bad
value. This can lead to a mediaserver crash because IOMX interface rely on
nSize to send the OMX parameter via android Binder.
---
modules/codec/omxil/iomx.cpp | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/modules/codec/omxil/iomx.cpp b/modules/codec/omxil/iomx.cpp
index b399018..c4c4ac6 100644
--- a/modules/codec/omxil/iomx.cpp
+++ b/modules/codec/omxil/iomx.cpp
@@ -133,8 +133,17 @@ static OMX_ERRORTYPE iomx_send_command(OMX_HANDLETYPE component, OMX_COMMANDTYPE
static OMX_ERRORTYPE iomx_get_parameter(OMX_HANDLETYPE component, OMX_INDEXTYPE param_index, OMX_PTR param)
{
+ /*
+ * Some QCOM OMX_getParameter implementations override the nSize element to
+ * a bad value. So, save the initial nSize in order to restore it after.
+ */
+ OMX_U32 nSize = *(OMX_U32*)param;
+ OMX_ERRORTYPE error;
OMXNode* node = (OMXNode*) ((OMX_COMPONENTTYPE*)component)->pComponentPrivate;
- return get_error(ctx->iomx->getParameter(node->node, param_index, param, *(OMX_U32*)param));
+
+ error = get_error(ctx->iomx->getParameter(node->node, param_index, param, nSize));
+ *(OMX_U32*)param = nSize;
+ return error;
}
static OMX_ERRORTYPE iomx_set_parameter(OMX_HANDLETYPE component, OMX_INDEXTYPE param_index, OMX_PTR param)
--
1.7.10.4
--
This email and any files transmitted with it are confidential and are
intended solely for the use of the individual or entity to which they are
addressed. Access to this e-mail by anyone else is unauthorised. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken or omitted to be taken in reliance on it, is prohibited.
E-mail messages are not necessarily secure. Archos does not accept
responsibility for any changes made to this message after it was sent.
More information about the vlc-devel
mailing list