From: SooChan Lim Date: Tue, 15 Jun 2021 04:20:42 +0000 (+0900) Subject: tbm_module: check the bufmgr_func symbol at tbm_module_bufmgr_get_capabilities X-Git-Tag: submit/tizen/20210617.053259~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F87%2F259887%2F1;p=platform%2Fcore%2Fuifw%2Flibtbm.git tbm_module: check the bufmgr_func symbol at tbm_module_bufmgr_get_capabilities This avoids a crash when the bufmgr_funcs does not have a symbol. Change-Id: I27109d06403d974629badf17bc6ed8eb49cfd6cb --- diff --git a/src/tbm_module.c b/src/tbm_module.c index 1df44a8..d561406 100644 --- a/src/tbm_module.c +++ b/src/tbm_module.c @@ -461,6 +461,7 @@ int tbm_module_bufmgr_get_capabilities(tbm_module *module, tbm_error_e *error) { int capabilities = 0; + tbm_backend_bufmgr_func *bufmgr_func = NULL; TBM_RETURN_VAL_SET_ERR_IF_FAIL(module, TBM_BUFMGR_CAPABILITY_NONE, *error, TBM_ERROR_INVALID_PARAMETER); @@ -469,11 +470,16 @@ tbm_module_bufmgr_get_capabilities(tbm_module *module, tbm_error_e *error) capabilities = hal_tbm_bufmgr_get_capabilities(module->hal_bufmgr, (hal_tbm_error *)error); break; case TBM_MODULE_TYPE_TBM_BACKEND: + bufmgr_func = module->bufmgr_func; + TBM_RETURN_VAL_SET_ERR_IF_FAIL(bufmgr_func, 0, *error, TBM_ERROR_INVALID_OPERATION); + TBM_RETURN_VAL_SET_ERR_IF_FAIL(bufmgr_func->bufmgr_get_capabilities, 0, *error, TBM_ERROR_NOT_SUPPORTED); + capabilities = module->bufmgr_func->bufmgr_get_capabilities(module->bufmgr_data, error); break; case TBM_MODULE_TYPE_BUFMGR_BACKEND: TBM_WRN("!!WARNING: This backend interface will be DEPRECATED after Tizen 7.0."); TBM_ERR("Do not support at tbm_bufmgr_backend."); + *error = TBM_ERROR_NOT_SUPPORTED; break; default: