From: Sejun Park Date: Tue, 3 Apr 2018 06:37:59 +0000 (+0900) Subject: fixed coverity issues X-Git-Tag: accepted/tizen/unified/20180404.063301^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F00%2F174600%2F2;p=platform%2Fadaptation%2Fap_samsung%2Flibomxil-e3250-v4l2.git fixed coverity issues Change-Id: Ib7f02e17d2d986aa9d5f3e2edd7d01767ce1b5b3 --- diff --git a/exynos4/libswconverter/swconvertor.c b/exynos4/libswconverter/swconvertor.c index 115795e..81345a0 100755 --- a/exynos4/libswconverter/swconvertor.c +++ b/exynos4/libswconverter/swconvertor.c @@ -248,11 +248,6 @@ static void csc_tiled_to_linear_crop( temp1 = left&0x3F; if (temp3 > 192) { memcpy(yuv420_dest+linear_offset, nv12t_src+tiled_offset+temp1, 64-temp1); - temp2 = ((left+63)>>6)<<6; - temp3 = ((yuv420_width-right)>>6)<<6; - if (temp2 == temp3) { - temp2 = yuv420_width-right-(64-temp1); - } memcpy(yuv420_dest+linear_offset+64-temp1, nv12t_src+tiled_offset+2048, 64); memcpy(yuv420_dest+linear_offset+128-temp1, nv12t_src+tiled_offset1, 64); memcpy(yuv420_dest+linear_offset+192-temp1, nv12t_src+tiled_offset1+2048, 64); diff --git a/openmax/component/common/Exynos_OMX_Resourcemanager.c b/openmax/component/common/Exynos_OMX_Resourcemanager.c index 279a436..3d2a9c8 100755 --- a/openmax/component/common/Exynos_OMX_Resourcemanager.c +++ b/openmax/component/common/Exynos_OMX_Resourcemanager.c @@ -139,7 +139,7 @@ int searchLowPriority(EXYNOS_OMX_RM_COMPONENT_LIST *RMComp_list, OMX_U32 inComp_ EXYNOS_OMX_RM_COMPONENT_LIST *pCandidateComp = NULL; if (RMComp_list == NULL) - ret = -1; + return -1; pTempComp = RMComp_list; *outLowComp = 0; diff --git a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c index c104712..3b64361 100755 --- a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c +++ b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c @@ -503,7 +503,6 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps; ExynosVideoDecBufferOps *pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps; @@ -2304,13 +2303,8 @@ OMX_ERRORTYPE Exynos_H264Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX (displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) || (displayStatus == VIDEO_FRAME_STATUS_DECODING_FINISHED) || (CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { - if (pVideoBuffer != NULL) { - ret = OMX_ErrorNone; - break; - } else { - ret = OMX_ErrorUndefined; - break; - } + ret = OMX_ErrorNone; + break; } } diff --git a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c index e5018bf..b042680 100755 --- a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c +++ b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c @@ -637,7 +637,6 @@ OMX_ERRORTYPE Mpeg4CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent) EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle; void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle; EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX]; - EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX]; ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps; ExynosVideoDecBufferOps *pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps; @@ -2180,6 +2179,11 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX } if (pMpeg4Dec->hMFCMpeg4Handle.bConfiguredMFCDst == OMX_FALSE) { ret = Mpeg4CodecDstSetup(pOMXComponent); + + if (ret != OMX_ErrorNone) { + Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Mpeg4CodecDstSetup Failed"); + goto EXIT; + } } if (((bInStartCode = Check_Stream_StartCode(pSrcInputData->buffer.singlePlaneBuffer.dataBuffer, oneFrameSize, pMpeg4Dec->hMFCMpeg4Handle.codecType)) == OMX_TRUE) || @@ -2388,13 +2392,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM (displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) || (displayStatus == VIDEO_FRAME_STATUS_DECODING_FINISHED) || (CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { - if (pVideoBuffer != NULL) { - ret = OMX_ErrorNone; - break; - } else { - ret = OMX_ErrorUndefined; - break; - } + ret = OMX_ErrorNone; + break; } } diff --git a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c index 57c82f1..6970a55 100755 --- a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c +++ b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c @@ -2275,13 +2275,8 @@ OMX_ERRORTYPE Exynos_WmvDec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ (displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) || (displayStatus == VIDEO_FRAME_STATUS_DECODING_FINISHED) || (CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) { - if (pVideoBuffer != NULL) { - ret = OMX_ErrorNone; - break; - } else { - ret = OMX_ErrorUndefined; - break; - } + ret = OMX_ErrorNone; + break; } } diff --git a/openmax/component/video/enc/Exynos_OMX_VencControl.c b/openmax/component/video/enc/Exynos_OMX_VencControl.c index 5734400..1650bd9 100755 --- a/openmax/component/video/enc/Exynos_OMX_VencControl.c +++ b/openmax/component/video/enc/Exynos_OMX_VencControl.c @@ -632,8 +632,14 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush( Exynos_OSAL_MutexLock(pDataBuffer[1]->bufferMutex); ret = Exynos_OMX_FlushPort(pOMXComponent, nPortIndex); - if (ret != OMX_ErrorNone) + if (ret != OMX_ErrorNone) { + if (pDataBuffer[1] != NULL) + Exynos_OSAL_MutexUnlock(pDataBuffer[1]->bufferMutex); + + Exynos_OSAL_MutexUnlock(pDataBuffer[0]->bufferMutex); + goto EXIT; + } if (pExynosPort->bufferProcessType & BUFFER_COPY) pVideoEnc->exynos_codec_enqueueAllBuffer(pOMXComponent, nPortIndex); diff --git a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c index f4f7808..66ba582 100755 --- a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c +++ b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c @@ -1884,6 +1884,9 @@ OMX_ERRORTYPE Exynos_H264Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_ } if (pH264Enc->hMFCH264Handle.bConfiguredMFCDst == OMX_FALSE) { ret = H264CodecDstSetup(pOMXComponent); + + if (ret != OMX_ErrorNone) + goto EXIT; } if (pVideoEnc->configChange == OMX_TRUE) { Change_H264Enc_Param(pExynosComponent); diff --git a/openmax/osal/Exynos_OSAL_Platform_Specific.c b/openmax/osal/Exynos_OSAL_Platform_Specific.c index 889343b..cd2f669 100755 --- a/openmax/osal/Exynos_OSAL_Platform_Specific.c +++ b/openmax/osal/Exynos_OSAL_Platform_Specific.c @@ -265,7 +265,6 @@ OMX_ERRORTYPE Exynos_OSAL_UnlockPB(OMX_IN OMX_PTR pBuffer, EXYNOS_OMX_DATA *pDat Exynos_OSAL_Log(EXYNOS_LOG_TRACE,"foramt is %d, and y_size=%d, uv_size=%d",pExynosInPort->portDefinition.format.video.eCompressionFormat ,pSlpOutBuf->size[0],pSlpOutBuf->size[1]); } - pSlpOutBuf->type = MM_VIDEO_BUFFER_TYPE_TBM_BO; /* use bo mode */ pSlpOutBuf->handle_num = 2; pSlpOutBuf->plane_num = 2;