Commit cd69efe6 authored by Thomas Guillem's avatar Thomas Guillem Committed by Jean-Baptiste Kempf

iomx: fix mediaserver crash with QCOM devices.

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.
Signed-off-by: default avatarMartin Storsjö <martin@martin.st>
(cherry picked from commit ec8bf9d655a8d5d1b399dfe1dcd1219aee3e697b)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 4aed4bd4
...@@ -133,8 +133,17 @@ static OMX_ERRORTYPE iomx_send_command(OMX_HANDLETYPE component, OMX_COMMANDTYPE ...@@ -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) 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; 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) static OMX_ERRORTYPE iomx_set_parameter(OMX_HANDLETYPE component, OMX_INDEXTYPE param_index, OMX_PTR param)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment