From 927a1e5d8f2a3dbb4977ea86ce13907b8bcd022e Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Tue, 15 May 2018 20:44:38 +0900 Subject: [PATCH] tbm_surface: added checking parameter Change-Id: I83ea75390116783bf94f0dd814459f57675bc90d --- src/tbm_surface_internal.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/tbm_surface_internal.c b/src/tbm_surface_internal.c index 6fc9b55..6edc597 100644 --- a/src/tbm_surface_internal.c +++ b/src/tbm_surface_internal.c @@ -2599,16 +2599,14 @@ tbm_surface_internal_get_damage(tbm_surface_h surface, int *x, int *y, int *widt _tbm_surface_mutex_lock(); _tbm_set_last_result(TBM_ERROR_NONE); - TBM_SURFACE_RETURN_VAL_IF_FAIL(width > 0, 0); - TBM_SURFACE_RETURN_VAL_IF_FAIL(height > 0, 0); TBM_SURFACE_RETURN_VAL_IF_FAIL(_tbm_surface_internal_is_valid(surface), 0); surf = (struct _tbm_surface *)surface; - *x = surf->damage.x; - *y = surf->damage.y; - *width = surf->damage.width; - *height = surf->damage.height; + if (x) *x = surf->damage.x; + if (y) *y = surf->damage.y; + if (width) *width = surf->damage.width; + if (height) *height = surf->damage.height; TBM_TRACE_SURFACE_INTERNAL("tbm_surface(%p) x(%d) y(%d) width(%d) height(%d)\n", surface, *x, *y, *width, *height); -- 2.34.1