tbm_surface: added checking parameter 72/179072/3
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 15 May 2018 11:44:38 +0000 (20:44 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 15 May 2018 11:54:03 +0000 (11:54 +0000)
Change-Id: I83ea75390116783bf94f0dd814459f57675bc90d

src/tbm_surface_internal.c

index 6fc9b55..6edc597 100644 (file)
@@ -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);