diff options
| author | Martin Storsjo <martin@martin.st> | 2011-01-19 13:51:28 +0100 |
|---|---|---|
| committer | Steve Kondik <shade@chemlab.org> | 2011-01-22 03:09:40 -0500 |
| commit | b0017161d26e884cde7a88fa73f9d7d14fafaf8d (patch) | |
| tree | cd6e438e601afe29ade973c48557af97694e4033 | |
| parent | 4976e1b6affa46c0de5ad38d084d7bcca3b23008 (diff) | |
| download | android_hardware_qcom_media-b0017161d26e884cde7a88fa73f9d7d14fafaf8d.tar.gz android_hardware_qcom_media-b0017161d26e884cde7a88fa73f9d7d14fafaf8d.tar.bz2 android_hardware_qcom_media-b0017161d26e884cde7a88fa73f9d7d14fafaf8d.zip | |
Don't write into the OMX_SetParameter parameter data
If called over the IOMX binder bridge, this parameter is a pointer
to read only memory.
If the updated value nBufferSize value is wanted, the caller should
call OMX_GetParameter afterwards, which both Stagefright and OpenCORE
do.
Change-Id: I4c78114f4fe66c622501668bee336c94c8e0b900
| -rwxr-xr-x | mm-video/qdsp6/venc/omx/src/OMX_Venc.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mm-video/qdsp6/venc/omx/src/OMX_Venc.cpp b/mm-video/qdsp6/venc/omx/src/OMX_Venc.cpp index 10a87a63..25f8e2f1 100755 --- a/mm-video/qdsp6/venc/omx/src/OMX_Venc.cpp +++ b/mm-video/qdsp6/venc/omx/src/OMX_Venc.cpp @@ -1640,8 +1640,13 @@ OMX_ERRORTYPE Venc::update_param_port_fmt(OMX_IN OMX_VIDEO_PARAM_PORTFORMATTYPE* return result; } -OMX_ERRORTYPE Venc::update_param_port_def(OMX_IN OMX_PARAM_PORTDEFINITIONTYPE* pParam) +OMX_ERRORTYPE Venc::update_param_port_def(OMX_IN OMX_PARAM_PORTDEFINITIONTYPE* pOrigParam) { + // The code below tries to write to pParam - keep a local + // version instead of writing into the user specified data + // (which might be in read-only memory in some cases), and + // point pParam to that. + OMX_PARAM_PORTDEFINITIONTYPE localParam = *pOrigParam, *pParam = &localParam; OMX_ERRORTYPE result = OMX_ErrorNone; int rc = 0; if (pParam != NULL) |
