summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleksii Gulchenko <oleksii.gulchenko@ti.com>2012-11-02 13:03:05 +0200
committerSejal Barot <sejal@ti.com>2012-11-08 19:49:40 +0530
commit1307c3a722d05441f561cc26ea022b63578f4740 (patch)
tree57e670ac1c92b731bda1a6e8ce9fd4cb77cd64ac
parent88e023abe4cd6ccf306c82055ca1f20e0d0ce78f (diff)
downloaddomx-omapzoom-1307c3a722d05441f561cc26ea022b63578f4740.tar.gz
DOMX: Changed return code for non-successful memory allocation cases.
Functions "MemPlugin_ION_Alloc", "PROXY_AllocateBuffer" and "PROXY_UseBuffer" always returns successfull result, in unsuccessfull memory allocation cases. This behaviour caused crashes in code, which used these functions. Change-Id: I014905d7972d7a74d2de5051d34fdf52d90bca83 Signed-off-by: Oleksii Gulchenko <oleksii.gulchenko@ti.com>
-rw-r--r--domx/omx_proxy_common/src/omx_proxy_common.c2
-rwxr-xr-xdomx/plugins/memplugin_ion.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/domx/omx_proxy_common/src/omx_proxy_common.c b/domx/omx_proxy_common/src/omx_proxy_common.c
index 5423316..2de8668 100644
--- a/domx/omx_proxy_common/src/omx_proxy_common.c
+++ b/domx/omx_proxy_common/src/omx_proxy_common.c
@@ -798,6 +798,7 @@ OMX_ERRORTYPE PROXY_AllocateBuffer(OMX_IN OMX_HANDLETYPE hComponent,
if(eMemError != MEMPLUGIN_ERROR_NONE)
{
DOMX_ERROR("Allocation failed %d",eMemError);
+ eError = OMX_ErrorInsufficientResources;
goto EXIT;
}
pCompPrv->tBufList[currentBuffer].bufferAccessors[0].pBufferHandle = newbuffer_prop.sBuffer_accessor.pBufferHandle;
@@ -1069,6 +1070,7 @@ static OMX_ERRORTYPE PROXY_UseBuffer(OMX_IN OMX_HANDLETYPE hComponent,
if(eMemError != MEMPLUGIN_ERROR_NONE)
{
DOMX_ERROR("Allocation failed %d",eMemError);
+ eError = OMX_ErrorInsufficientResources;
goto EXIT;
}
((OMX_TI_PLATFORMPRIVATE *)pBufferHeader->
diff --git a/domx/plugins/memplugin_ion.c b/domx/plugins/memplugin_ion.c
index 5d0f3be..07b81cc 100755
--- a/domx/plugins/memplugin_ion.c
+++ b/domx/plugins/memplugin_ion.c
@@ -146,6 +146,7 @@ MEMPLUGIN_ERRORTYPE MemPlugin_ION_Alloc(void *pMemPluginHandle, OMX_U32 nClient,
{
eError = MEMPLUGIN_ERROR_BADPARAMETER;
DOMX_ERROR("%s: width should be positive %d", __FUNCTION__,pIonBufferParams->nWidth);
+ goto EXIT;
}
if(pMemPluginHdl->pPluginExtendedInfo == NULL)