summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordyamy-lee <dyamy.lee@samsung.com>2021-06-10 19:39:17 +0900
committerdyamy-lee <dyamy.lee@samsung.com>2021-06-10 19:39:17 +0900
commit2af0ef598adffb5d5bab731faa27da1156de2843 (patch)
tree3c1ce79a1e071a642270a5b16016ae8b9ba55d2e
parent9ab99bba893aa4b4a7b855f1bdecec5a78419558 (diff)
downloadfirmware-update-system-ui-2af0ef598adffb5d5bab731faa27da1156de2843.tar.gz
firmware-update-system-ui-2af0ef598adffb5d5bab731faa27da1156de2843.tar.bz2
firmware-update-system-ui-2af0ef598adffb5d5bab731faa27da1156de2843.zip
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.c18
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,