From: SooChan Lim Date: Fri, 19 Mar 2021 08:52:57 +0000 (+0900) Subject: fix the memory allocation failed. X-Git-Tag: accepted/tizen/unified/20210324.124652^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Flibtbm.git;a=commitdiff_plain;h=ab04c779631fd2c5ea19fe37dac897640bfcff27 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 --- 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) {