summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunkyeong Kim <jk0430.kim@samsung.com>2021-03-02 10:15:27 +0900
committerJunkyeong Kim <jk0430.kim@samsung.com>2021-03-02 10:25:59 +0900
commit6749ce8a51ef8c561423f052f581dd5d9c085953 (patch)
tree085fc17fc3a39136c3e7f0d211d8c389397f6c3f
parent37e9e9a8df0860ce394d50c19c98155ecb7cd799 (diff)
downloadlibtbm-tizen_5.5.tar.gz
libtbm-tizen_5.5.tar.bz2
libtbm-tizen_5.5.zip
tbm_surface_internal: check bufmgr init success before list inittizen_5.5
Change-Id: I4b18a5b8375146d7518665d871585d8b8613027a Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
-rw-r--r--src/tbm_surface_internal.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tbm_surface_internal.c b/src/tbm_surface_internal.c
index f966fbb..8c31de2 100644
--- a/src/tbm_surface_internal.c
+++ b/src/tbm_surface_internal.c
@@ -602,6 +602,11 @@ tbm_surface_internal_query_supported_formats(uint32_t **formats,
if (!g_surface_bufmgr) {
_init_surface_bufmgr();
+ if (!g_surface_bufmgr) {
+ TBM_ERR("fail bufmgr initialization\n");
+ _tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
+ goto fail;
+ }
LIST_INITHEAD(&g_surface_bufmgr->surf_list);
bufmgr_initialized = true;
}
@@ -733,6 +738,11 @@ tbm_surface_internal_create_with_flags(int width, int height,
if (!g_surface_bufmgr) {
_init_surface_bufmgr();
+ if (!g_surface_bufmgr) {
+ TBM_ERR("fail bufmgr initialization\n");
+ _tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
+ goto check_valid_fail;
+ }
LIST_INITHEAD(&g_surface_bufmgr->surf_list);
bufmgr_initialized = true;
}
@@ -740,6 +750,7 @@ tbm_surface_internal_create_with_flags(int width, int height,
bufmgr = g_surface_bufmgr;
if (!TBM_BUFMGR_IS_VALID(bufmgr)) {
TBM_ERR("The bufmgr is invalid\n");
+ _tbm_set_last_result(TBM_ERROR_INVALID_PARAMETER);
goto check_valid_fail;
}
@@ -978,6 +989,11 @@ tbm_surface_internal_create_with_bos(tbm_surface_info_s *info,
if (!g_surface_bufmgr) {
_init_surface_bufmgr();
+ if (!g_surface_bufmgr) {
+ TBM_ERR("fail bufmgr initialization\n");
+ _tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
+ goto check_valid_fail;
+ }
LIST_INITHEAD(&g_surface_bufmgr->surf_list);
bufmgr_initialized = true;
}