vdec: resolved prevent defects
authorTaehwan Kim <t_h.kim@samsung.com>
Mon, 29 Oct 2012 04:05:00 +0000 (13:05 +0900)
committerHuisung Kang <hs1218.kang@samsung.com>
Mon, 29 Oct 2012 04:54:22 +0000 (13:54 +0900)
resolved defects like below
 1. UNREACHABLE
 2. NO_EFFECT
 3. FORWARD_NULL
 4. DEADCODE

Change-Id: Id1961c3bd693f28eb0d7d87d702f5899ec954225
Signed-off-by: Taehwan Kim <t_h.kim@samsung.com>
Signed-off-by: Huisung Kang <hs1218.kang@samsung.com>
component/video/dec/h264/Exynos_OMX_H264dec.c
component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c
component/video/dec/vp8/Exynos_OMX_Vp8dec.c
component/video/enc/h264/Exynos_OMX_H264enc.c
component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c

index dec8e711dc1a0bd858d38b2d81e441cfefd6fba3..2868d8b41e8ecbb4df9bcaec6621d3090ac9fc47 100644 (file)
@@ -1875,7 +1875,7 @@ OMX_ERRORTYPE Exynos_H264Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX
     EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
     ExynosVideoDecOps       *pDecOps    = pH264Dec->hMFCH264Handle.pDecOps;
     ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
-    ExynosVideoBuffer       *pVideoBuffer;
+    ExynosVideoBuffer       *pVideoBuffer = NULL;
     ExynosVideoFrameStatusType displayStatus = VIDEO_FRAME_STATUS_UNKNOWN;
     ExynosVideoGeometry *bufferGeometry;
     DECODE_CODEC_EXTRA_BUFFERINFO *pBufferInfo = NULL;
@@ -1901,19 +1901,11 @@ OMX_ERRORTYPE Exynos_H264Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX
             (displayStatus == VIDEO_FRAME_STATUS_DISPLAY_ONLY) ||
             (displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) ||
             (CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) {
-            if (pVideoBuffer != NULL) {
-                ret = OMX_ErrorNone;
-                break;
-            } else {
-                ret = OMX_ErrorUndefined;
-                break;
-            }
+            ret = OMX_ErrorNone;
+            break;
         }
     }
 
-    if (ret != OMX_ErrorNone)
-        goto EXIT;
-
     pH264Dec->hMFCH264Handle.outputIndexTimestamp++;
     pH264Dec->hMFCH264Handle.outputIndexTimestamp %= MAX_TIMESTAMP;
 
index 4bea31b1624d1e4682350938812121724040ecc5..5a220558ec8d241ac1d1bb68bdd25da09b49383e 100644 (file)
@@ -1929,7 +1929,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM
     EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
     ExynosVideoDecOps       *pDecOps    = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
     ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
-    ExynosVideoBuffer       *pVideoBuffer;
+    ExynosVideoBuffer       *pVideoBuffer = NULL;
     ExynosVideoFrameStatusType displayStatus = VIDEO_FRAME_STATUS_UNKNOWN;
     ExynosVideoGeometry *bufferGeometry;
     DECODE_CODEC_EXTRA_BUFFERINFO *pBufferInfo = NULL;
@@ -1955,19 +1955,11 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM
             (displayStatus == VIDEO_FRAME_STATUS_DISPLAY_ONLY) ||
             (displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) ||
             (CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) {
-            if (pVideoBuffer != NULL) {
-                ret = OMX_ErrorNone;
-                break;
-            } else {
-                ret = OMX_ErrorUndefined;
-                break;
-            }
+            ret = OMX_ErrorNone;
+            break;
         }
     }
 
-    if (ret != OMX_ErrorNone)
-        goto EXIT;
-
     pMpeg4Dec->hMFCMpeg4Handle.outputIndexTimestamp++;
     pMpeg4Dec->hMFCMpeg4Handle.outputIndexTimestamp %= MAX_TIMESTAMP;
 
index 2d4169a2e4c5755e34adc6b5085b6fa83fd3c119..c14ec9d08f3dc11ec004a21d1ef9a0a0dcb8126b 100644 (file)
@@ -1521,7 +1521,7 @@ OMX_ERRORTYPE Exynos_VP8Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_
     EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
     ExynosVideoDecOps       *pDecOps    = pVp8Dec->hMFCVp8Handle.pDecOps;
     ExynosVideoDecBufferOps *pOutbufOps = pVp8Dec->hMFCVp8Handle.pOutbufOps;
-    ExynosVideoBuffer       *pVideoBuffer;
+    ExynosVideoBuffer       *pVideoBuffer = NULL;
     ExynosVideoFrameStatusType displayStatus = VIDEO_FRAME_STATUS_UNKNOWN;
     ExynosVideoGeometry *bufferGeometry;
     DECODE_CODEC_EXTRA_BUFFERINFO *pBufferInfo = NULL;
@@ -1547,19 +1547,11 @@ OMX_ERRORTYPE Exynos_VP8Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_
             (displayStatus == VIDEO_FRAME_STATUS_DISPLAY_ONLY) ||
             (displayStatus == VIDEO_FRAME_STATUS_CHANGE_RESOL) ||
             (CHECK_PORT_BEING_FLUSHED(pExynosOutputPort))) {
-            if (pVideoBuffer != NULL) {
-                ret = OMX_ErrorNone;
-                break;
-            } else {
-                ret = OMX_ErrorUndefined;
-                break;
-            }
+            ret = OMX_ErrorNone;
+            break;
         }
     }
 
-    if (ret != OMX_ErrorNone)
-        goto EXIT;
-
     pVp8Dec->hMFCVp8Handle.outputIndexTimestamp++;
     pVp8Dec->hMFCVp8Handle.outputIndexTimestamp %= MAX_TIMESTAMP;
 
index 8a1b937d0a6f5387b809aee108c001475756364d..b2caa7ddb82e9bbeafd5e5f4841bf494462156d8 100644 (file)
@@ -1745,7 +1745,7 @@ OMX_ERRORTYPE Exynos_H264Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_
         ret = H264CodecDstSetup(pOMXComponent);
     }
 
-    if ((pSrcInputData->dataLen >= 0) ||
+    if ((pSrcInputData->dataLen > 0) ||
         ((pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) {
         OMX_U32 nAllocLen[MFC_INPUT_BUFFER_PLANE] = {0, 0};
         OMX_U32 pMFCYUVDataSize[MFC_INPUT_BUFFER_PLANE]  = {NULL, NULL};
index 4a5f1741c6a38ac1aa02a9fc159c0515659c225e..1723f98cf12a4bd679e7903bde8a172d85c978f3 100644 (file)
@@ -1955,7 +1955,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX
         ret = Mpeg4CodecDstSetup(pOMXComponent);
     }
 
-    if ((pSrcInputData->dataLen >= 0) ||
+    if ((pSrcInputData->dataLen > 0) ||
         ((pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) {
         OMX_U32 nAllocLen[MFC_INPUT_BUFFER_PLANE] = {0, 0};
         OMX_U32 pMFCYUVDataSize[MFC_INPUT_BUFFER_PLANE]  = {NULL, NULL};