From: Taehwan Kim Date: Mon, 29 Oct 2012 04:18:30 +0000 (+0900) Subject: vdec: modified an error check routine X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=17c966307712d82374e3df1ce9eda06128f50862;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_openmax.git vdec: modified an error check routine If do "buffer flush" without doing srcIn function, In case of BUFFER_COPY, always return OMX_ErrorBadParameter in the codecEnQueueAllBuffer function. Change-Id: I01e8f421b68d6f66b0939334fc128901fb30210d Signed-off-by: Taehwan Kim Signed-off-by: Huisung Kang --- diff --git a/component/video/dec/h264/Exynos_OMX_H264dec.c b/component/video/dec/h264/Exynos_OMX_H264dec.c index a681b55..b834316 100644 --- a/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -558,6 +558,11 @@ OMX_ERRORTYPE H264CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U3 FunctionIn(); + if ((nPortIndex != INPUT_PORT_INDEX) && (nPortIndex != OUTPUT_PORT_INDEX)) { + ret = OMX_ErrorBadPortIndex; + goto EXIT; + } + if ((nPortIndex == INPUT_PORT_INDEX) && (pH264Dec->bSourceStart == OMX_TRUE)) { Exynos_CodecBufferReset(pExynosComponent, INPUT_PORT_INDEX); @@ -584,9 +589,6 @@ OMX_ERRORTYPE H264CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U3 Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, (OMX_PTR)pBuffer); } pOutbufOps->Clear_Queue(hMFCHandle); - } else { - ret = OMX_ErrorBadParameter; - goto EXIT; } EXIT: diff --git a/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index 1e6f36a..9c7238b 100644 --- a/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -650,6 +650,11 @@ OMX_ERRORTYPE Mpeg4CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U FunctionIn(); + if ((nPortIndex != INPUT_PORT_INDEX) && (nPortIndex != OUTPUT_PORT_INDEX)) { + ret = OMX_ErrorBadPortIndex; + goto EXIT; + } + if ((nPortIndex == INPUT_PORT_INDEX) && (pMpeg4Dec->bSourceStart == OMX_TRUE)) { Exynos_CodecBufferReset(pExynosComponent, INPUT_PORT_INDEX); @@ -676,9 +681,6 @@ OMX_ERRORTYPE Mpeg4CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, (OMX_PTR)pBuffer); } pOutbufOps->Clear_Queue(hMFCHandle); - } else { - ret = OMX_ErrorBadParameter; - goto EXIT; } EXIT: diff --git a/component/video/dec/vp8/Exynos_OMX_Vp8dec.c b/component/video/dec/vp8/Exynos_OMX_Vp8dec.c index cfb57ca..0565065 100644 --- a/component/video/dec/vp8/Exynos_OMX_Vp8dec.c +++ b/component/video/dec/vp8/Exynos_OMX_Vp8dec.c @@ -465,6 +465,11 @@ OMX_ERRORTYPE VP8CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 FunctionIn(); + if ((nPortIndex != INPUT_PORT_INDEX) && (nPortIndex != OUTPUT_PORT_INDEX)) { + ret = OMX_ErrorBadPortIndex; + goto EXIT; + } + if ((nPortIndex == INPUT_PORT_INDEX) && (pVp8Dec->bSourceStart == OMX_TRUE)) { Exynos_CodecBufferReset(pExynosComponent, INPUT_PORT_INDEX); @@ -491,9 +496,6 @@ OMX_ERRORTYPE VP8CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 Exynos_CodecBufferEnQueue(pExynosComponent, OUTPUT_PORT_INDEX, (OMX_PTR)pBuffer); } pOutbufOps->Clear_Queue(hMFCHandle); - } else { - ret = OMX_ErrorBadParameter; - goto EXIT; } EXIT: