From: Dongyeon Kim Date: Thu, 12 Nov 2015 08:30:53 +0000 (+0900) Subject: evas/gl_generic: Check for errors when calling tbm surface map/unmap X-Git-Tag: upstream/1.20.0~8227 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8c2f9a2669b27fcb904205d7422971648f86b246;p=platform%2Fupstream%2Fefl.git evas/gl_generic: Check for errors when calling tbm surface map/unmap tbm_surface_map/unmap might fail and return error, so we need to check the return value of these APIs. --- diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c index 6adea19..8278b05 100644 --- a/src/modules/evas/engines/gl_generic/evas_engine.c +++ b/src/modules/evas/engines/gl_generic/evas_engine.c @@ -757,10 +757,15 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, i if ((im->gc->shared->info.sec_tbm_surface) && (secsym_tbm_surface_map)) { tbm_surface_info_s info; - secsym_tbm_surface_map(im->tex->pt->dyn.buffer, + if (secsym_tbm_surface_map(im->tex->pt->dyn.buffer, TBM_SURF_OPTION_READ|TBM_SURF_OPTION_WRITE, - &info); - *image_data = im->tex->pt->dyn.data = (DATA32 *) info.planes[0].ptr; + &info)) + { + ERR("tbm_surface_map failed!"); + *image_data = im->tex->pt->dyn.data = NULL; + } + else + *image_data = im->tex->pt->dyn.data = (DATA32 *) info.planes[0].ptr; } else if ((im->gc->shared->info.sec_image_map) && (secsym_eglMapImageSEC)) { @@ -933,7 +938,10 @@ eng_image_data_put(void *data, void *image, DATA32 *image_data) if (im->tex->pt->dyn.checked_out == 0) { if (im->gc->shared->info.sec_tbm_surface) - secsym_tbm_surface_unmap(im->tex->pt->dyn.buffer); + { + if (secsym_tbm_surface_unmap(im->tex->pt->dyn.buffer)) + ERR("tbm_surface_unmap failed!"); + } else if (im->gc->shared->info.sec_image_map) { void *disp = disp = re->window_egl_display_get(re->software.ob);