From 17c966307712d82374e3df1ce9eda06128f50862 Mon Sep 17 00:00:00 2001 From: Taehwan Kim Date: Mon, 29 Oct 2012 13:18:30 +0900 Subject: [PATCH] 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 --- component/video/dec/h264/Exynos_OMX_H264dec.c | 8 +++++--- component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c | 8 +++++--- component/video/dec/vp8/Exynos_OMX_Vp8dec.c | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) 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: -- 2.20.1