From ab04c779631fd2c5ea19fe37dac897640bfcff27 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Fri, 19 Mar 2021 17:52:57 +0900 Subject: [PATCH] fix the memory allocation failed. libtbm must calls tbm_bo_alloc function when tbm_bo_alloc_with_format is not supported at the backend module. Change-Id: Ie2c3e161b278b88c724d2be7023399895574298b --- src/tbm_surface_internal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/tbm_surface_internal.c b/src/tbm_surface_internal.c index 0618fe4..17aa777 100644 --- a/src/tbm_surface_internal.c +++ b/src/tbm_surface_internal.c @@ -852,13 +852,11 @@ tbm_surface_internal_create_with_flags(int width, int height, if (bufmgr->use_hal_tbm) { surf->bos[i] = tbm_bo_alloc_with_format(bufmgr, format, i, width, height, surf->info.bpp/8, flags, &error); if (error == TBM_ERROR_NOT_SUPPORTED) { - if (error != TBM_ERROR_NONE) { + surf->bos[i] = tbm_bo_alloc(bufmgr, bo_size, flags); + if (!surf->bos[i]) { TBM_ERR("fail to alloc bo idx:%d\n", i); goto alloc_bo_fail; } - } else if (error != TBM_ERROR_NONE) { - TBM_ERR("fail to alloc bo idx:%d\n", i); - goto alloc_bo_fail; } } else if (bufmgr->backend_module_data) { if (bufmgr->bufmgr_func->bufmgr_alloc_bo_with_format) { -- 2.7.4