From: Sangjin Lee Date: Wed, 29 Jun 2016 13:07:00 +0000 (+0900) Subject: Fix svace critial and major issue X-Git-Tag: submit/tizen/20160629.135923~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2cc61e51078d88c7f93221ad5fc27fdee5041b87;p=platform%2Fcore%2Fuifw%2Fpepper.git Fix svace critial and major issue Change-Id: Ic8bb6f890910b2cb35e0d4efefc75278e91674a0 --- diff --git a/src/bin/doctor/server.c b/src/bin/doctor/server.c index a12f8d9..c692feb 100644 --- a/src/bin/doctor/server.c +++ b/src/bin/doctor/server.c @@ -35,7 +35,14 @@ main(int argc, char **argv) pepper_compositor_t *compositor; compositor = pepper_compositor_create("wayland-0"); + if (!compositor) + return -1; + display = pepper_compositor_get_display(compositor); + if (!display) { + pepper_compositor_destroy(compositor); + return -1; + } /* Enter main loop. */ wl_display_run(display); diff --git a/src/lib/desktop-shell/shell-surface.c b/src/lib/desktop-shell/shell-surface.c index ea479e5..74869bc 100644 --- a/src/lib/desktop-shell/shell-surface.c +++ b/src/lib/desktop-shell/shell-surface.c @@ -1368,6 +1368,8 @@ shell_surface_resize(shell_surface_t *shsurf, pepper_seat_t *seat, { pepper_pointer_t *pointer = pepper_seat_get_pointer(seat); + PEPPER_CHECK(pointer, return, "pointer does not exist.\n"); + if (shsurf->type == SHELL_SURFACE_TYPE_FULLSCREEN || shsurf->type == SHELL_SURFACE_TYPE_MAXIMIZED || shsurf->type == SHELL_SURFACE_TYPE_MINIMIZED) { diff --git a/src/lib/drm/drm-common.c b/src/lib/drm/drm-common.c index a02d8af..7c2f98d 100644 --- a/src/lib/drm/drm-common.c +++ b/src/lib/drm/drm-common.c @@ -87,7 +87,7 @@ find_primary_gpu(struct udev *udev) /* FIXME: copied from weston */ static void drm_sprd_init(int fd) { - drmVersionPtr drm_info; + drmVersionPtr drm_info=NULL; int drmIRQ = 78; int length = 0; @@ -96,6 +96,8 @@ drm_sprd_init(int fd) } drm_info = drmGetVersion(fd); + PEPPER_CHECK(drm_info, return, "drmGetVersion() failed.\n"); + length = drm_info->name_len; if (length != 4) { diff --git a/src/lib/drm/drm-output.c b/src/lib/drm/drm-output.c index d68639e..e4c18a6 100644 --- a/src/lib/drm/drm-output.c +++ b/src/lib/drm/drm-output.c @@ -279,6 +279,9 @@ assign_overlay_plane(drm_output_t *output, pepper_view_t *view) if (!surface) return NULL; + pepper_view_get_position(view, &x, &y); + pepper_view_get_size(view, &w, &h); + buffer = pepper_surface_get_buffer(surface); if (!buffer) return NULL; @@ -350,8 +353,6 @@ assign_overlay_plane(drm_output_t *output, pepper_view_t *view) } /* set position */ - pepper_view_get_position(view, &x, &y); - pepper_view_get_size(view, &w, &h); plane->dx = (int)x; plane->dy = (int)y; plane->dw = w; diff --git a/src/lib/pepper/subsurface.c b/src/lib/pepper/subsurface.c index e720bc0..eeea1f9 100644 --- a/src/lib/pepper/subsurface.c +++ b/src/lib/pepper/subsurface.c @@ -614,6 +614,9 @@ subsurface_create_children_views(pepper_subsurface_t *subsurface, if (child && (child != subsurface)) { pepper_view_t *view = pepper_compositor_add_view( subsurface->surface->compositor); + + PEPPER_CHECK(view, continue, "pepper_compositor_add_view() failed\n"); + pepper_view_set_surface(view, child->surface); pepper_view_set_parent(view, parent_view); pepper_view_set_transform_inherit(view, PEPPER_TRUE); diff --git a/src/lib/pepper/touch.c b/src/lib/pepper/touch.c index 3f6af7d..836ecf5 100644 --- a/src/lib/pepper/touch.c +++ b/src/lib/pepper/touch.c @@ -111,6 +111,8 @@ pepper_touch_handle_event(pepper_touch_t *touch, uint32_t id, case PEPPER_EVENT_TOUCH_MOTION: { pepper_touch_point_t *point = get_touch_point(touch, event->slot); + PEPPER_CHECK(point, return, "get_touch_point() failed.\n"); + point->x = event->x; point->y = event->y; @@ -296,6 +298,8 @@ pepper_touch_set_focus(pepper_touch_t *touch, uint32_t id, pepper_view_t *focus) { pepper_touch_point_t *point = get_touch_point(touch, id); + PEPPER_CHECK(point, return, "Touch point %d does not exist.\n", id); + if (focus) { if (!point) pepper_touch_add_point(touch, id, 0, 0); diff --git a/src/lib/pepper/utils-log.c b/src/lib/pepper/utils-log.c index dab511b..80f03aa 100644 --- a/src/lib/pepper/utils-log.c +++ b/src/lib/pepper/utils-log.c @@ -56,8 +56,7 @@ pepper_print_timestamp(void) if (!brokendown_time) return fprintf(pepper_log_file, "failed to calloc for brokendown_time\n"); - localtime_r(&tv.tv_sec, brokendown_time); - if (brokendown_time == NULL) + if (!localtime_r(&tv.tv_sec, brokendown_time)) return fprintf(pepper_log_file, "[(NULL)localtime] "); if (brokendown_time->tm_mday != cached_tm_mday) { diff --git a/src/lib/render/gl-renderer.c b/src/lib/render/gl-renderer.c index 185d22a..572c9de 100644 --- a/src/lib/render/gl-renderer.c +++ b/src/lib/render/gl-renderer.c @@ -1496,7 +1496,7 @@ setup_egl_extensions(gl_renderer_t *gr) gr->unbind_display = (void *)eglGetProcAddress("eglUnbindWaylandDisplayWL"); gr->query_buffer = (void *)eglGetProcAddress("eglQueryWaylandBufferWL"); - if (!gr->bind_display(gr->display, + if (!gr->bind_display || !gr->bind_display(gr->display, pepper_compositor_get_display(gr->base.compositor))) { gr->bind_display = NULL; gr->unbind_display = NULL;