From 50bbcbe20bfdcc52a35d9d478dbe64ad7d836a9a Mon Sep 17 00:00:00 2001 From: Dheeraj CVR Date: Fri, 1 Aug 2014 05:26:42 +0530 Subject: [PATCH] omx_core: fix heap corruption when unregistering component Change-Id: Ie5c20e48f376054b1fe468274128e4c19c2ef3d1 --- exynos/multimedia/openmax/core/SEC_OMX_Component_Register.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exynos/multimedia/openmax/core/SEC_OMX_Component_Register.c b/exynos/multimedia/openmax/core/SEC_OMX_Component_Register.c index 27a88056..8c274ca9 100644 --- a/exynos/multimedia/openmax/core/SEC_OMX_Component_Register.c +++ b/exynos/multimedia/openmax/core/SEC_OMX_Component_Register.c @@ -141,8 +141,10 @@ OMX_ERRORTYPE SEC_OMX_Component_Unregister(SEC_OMX_COMPONENT_REGLIST *componentL { OMX_ERRORTYPE ret = OMX_ErrorNone; - SEC_OSAL_Memset(componentList, 0, sizeof(SEC_OMX_COMPONENT_REGLIST) * MAX_OMX_COMPONENT_NUM); - SEC_OSAL_Free(componentList); + if (componentList != NULL) { + SEC_OSAL_Memset(componentList, 0, sizeof(SEC_OMX_COMPONENT_REGLIST) * MAX_OMX_COMPONENT_NUM); + SEC_OSAL_Free(componentList); + } EXIT: return ret;