diff options
author | dyamy-lee <dyamy.lee@samsung.com> | 2021-06-10 19:39:17 +0900 |
---|---|---|
committer | dyamy-lee <dyamy.lee@samsung.com> | 2021-06-10 19:39:17 +0900 |
commit | 2af0ef598adffb5d5bab731faa27da1156de2843 (patch) | |
tree | 3c1ce79a1e071a642270a5b16016ae8b9ba55d2e | |
parent | 9ab99bba893aa4b4a7b855f1bdecec5a78419558 (diff) | |
download | firmware-update-system-ui-2af0ef598adffb5d5bab731faa27da1156de2843.tar.gz firmware-update-system-ui-2af0ef598adffb5d5bab731faa27da1156de2843.tar.bz2 firmware-update-system-ui-2af0ef598adffb5d5bab731faa27da1156de2843.zip |
Checked return valuetizen_8.0_m2_releasetizen_7.0_m2_releasetizen_6.5.m2_releasesubmit/tizen_6.5/20211028.163901submit/tizen/20210611.044056accepted/tizen/unified/riscv/20231226.211115accepted/tizen/unified/20210611.144943accepted/tizen/8.0/unified/20231005.095716accepted/tizen/7.0/unified/hotfix/20221116.111605accepted/tizen/7.0/unified/20221110.061537accepted/tizen/6.5/unified/20211029.015617tizen_8.0tizen_7.0_hotfixtizen_7.0tizen_6.5accepted/tizen_8.0_unifiedaccepted/tizen_7.0_unified_hotfixaccepted/tizen_7.0_unifiedaccepted/tizen_6.5_unified
Changed coverity rule checked the function which has return value.
So, following this rule, add checking return value of tbm_surface fuction.
Change-Id: Ic717804a8bdc6a2b97b0eba37e1c2f1978c5f163
-rw-r--r-- | base/base_gui_direct.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/base/base_gui_direct.c b/base/base_gui_direct.c index 676ad35..2b497d1 100644 --- a/base/base_gui_direct.c +++ b/base/base_gui_direct.c @@ -450,12 +450,18 @@ static void __init_screen(FbInfo *fbi) /* create tbm_surface for original image */ tbm_surface_h tbm_surface_ori = NULL; tbm_surface_info_s surface_info_ori; + tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE; + tbm_surface_ori = tbm_surface_create(img_buf_width, img_buf_height, TBM_FORMAT_ARGB8888); // rotated width, height if(!tbm_surface_ori){ LOG("failed to tbm_surface_create\n"); + return; + } + result = tbm_surface_map(tbm_surface_ori, TBM_SURF_OPTION_READ | TBM_SURF_OPTION_WRITE, &surface_info_ori); + if(result != TBM_SURFACE_ERROR_NONE) { + LOG("tbm_surface_map failed: %d\n", result); + return; } - tbm_surface_map(tbm_surface_ori, TBM_SURF_OPTION_READ | TBM_SURF_OPTION_WRITE, &surface_info_ori); - _gr_direct_clear_screen_init(&surface_info_ori, COLOR_BLACK); @@ -543,12 +549,18 @@ void fota_gr_direct_progress(int * saved_percent, int * percent_to_draw) /* create tbm_surface for original image */ tbm_surface_h tbm_surface_ori = NULL; tbm_surface_info_s surface_info_ori; + tbm_surface_error_e result = TBM_SURFACE_ERROR_NONE; tbm_surface_ori = tbm_surface_create(img_buf_width, img_buf_height, TBM_FORMAT_ARGB8888); // rotated width, height if(!tbm_surface_ori){ LOG("failed to tbm_surface_create\n"); + return; + } + result = tbm_surface_map(tbm_surface_ori, TBM_SURF_OPTION_READ | TBM_SURF_OPTION_WRITE, &surface_info_ori); + if(result != TBM_SURFACE_ERROR_NONE) { + LOG("tbm_surface_map failed: %d\n", result); + return; } - tbm_surface_map(tbm_surface_ori, TBM_SURF_OPTION_READ | TBM_SURF_OPTION_WRITE, &surface_info_ori); // need to keep previous image _copy_buffers_by_rotate(s_fbi.buf[0], s_fbi.w, s_fbi.h, s_fbi.w * RGB32_PITCH, surface_info_ori.planes[0].ptr, surface_info_ori.width, surface_info_ori.height, surface_info_ori.planes[0].stride, |