[vlc-devel] [PATCH] iomx: fix mediaserver crash with QCOM devices.

Martin Storsjö martin at martin.st
Thu Jul 3 17:53:01 CEST 2014


On Thu, 3 Jul 2014, Thomas Guillem wrote:

> 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

LGTM, will push

// Martin



More information about the vlc-devel mailing list