diff options
author | Weian Chen <weian.chen@intel.com> | 2013-10-11 07:26:42 -0700 |
---|---|---|
committer | Patrick Tjin <pattjin@google.com> | 2014-07-21 22:02:54 -0700 |
commit | 553a7a54b12af58aaf776692247fbf88b5a06e5d (patch) | |
tree | 6f4e3d2bbf24e494d8683ff52b55f6c28b956524 /videocodec/OMXVideoDecoderBase.cpp | |
parent | 156e4b05d6c6e69b0508195aa45d6376c25c94c4 (diff) | |
download | android_hardware_intel_common_omx-components-553a7a54b12af58aaf776692247fbf88b5a06e5d.tar.gz android_hardware_intel_common_omx-components-553a7a54b12af58aaf776692247fbf88b5a06e5d.tar.bz2 android_hardware_intel_common_omx-components-553a7a54b12af58aaf776692247fbf88b5a06e5d.zip |
[PORT FROM R42-TW]omx-component: avoid crash when caller passes NULL parameter to GetDecoderOutputCrop()
BZ: 144625
Add parameter check for GetDecoderOutputCrop() to avoid crash, when the uplayer
caller passes in the NULL pointer
Add check for function SetDecoderRotation() also.
Change-Id: I894446e0a8f8c57ac8defdc6fc52d9ecdd2aca7b
Orig-Change-Id: I8a074d93a3784049765a0c5c7d881b00067b2b91
Signed-off-by: Weian Chen <weian.chen@intel.com>
Signed-off-by: Dan Liang <dan.liang@intel.com>
Diffstat (limited to 'videocodec/OMXVideoDecoderBase.cpp')
-rwxr-xr-x | videocodec/OMXVideoDecoderBase.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/videocodec/OMXVideoDecoderBase.cpp b/videocodec/OMXVideoDecoderBase.cpp index 0a60aef..a4dbe63 100755 --- a/videocodec/OMXVideoDecoderBase.cpp +++ b/videocodec/OMXVideoDecoderBase.cpp @@ -823,14 +823,22 @@ OMX_ERRORTYPE OMXVideoDecoderBase::SetDecoderRotation(OMX_PTR pStructure) { CHECK_SET_PARAM_STATE(); int32_t rotationDegrees = 0; - rotationDegrees = *(static_cast<int32_t*>(pStructure)); - mRotationDegrees = rotationDegrees; + if (pStructure) { + rotationDegrees = *(static_cast<int32_t*>(pStructure)); + mRotationDegrees = rotationDegrees; - return OMX_ErrorNone; + return OMX_ErrorNone; + } else + return OMX_ErrorBadParameter; } OMX_ERRORTYPE OMXVideoDecoderBase::GetDecoderOutputCrop(OMX_PTR pStructure) { + + OMX_ERRORTYPE ret; OMX_CONFIG_RECTTYPE *rectParams = (OMX_CONFIG_RECTTYPE *)pStructure; + + CHECK_TYPE_HEADER(rectParams); + if (rectParams->nPortIndex != OUTPORT_INDEX) { return OMX_ErrorUndefined; } |