diff options
author | Xuelian Bai <xuelian.bai@samsung.com> | 2019-05-05 19:27:39 +0800 |
---|---|---|
committer | SooChan Lim <sc1.lim@samsung.com> | 2019-05-07 00:52:53 +0000 |
commit | b0dec10d0d0fbc7f77623016f3d986122f718f8b (patch) | |
tree | c57435318f32e12715a780fc107ef6a378a07237 | |
parent | 78860276d442ef2be075c1c0043bf098e4a61b50 (diff) | |
download | mesa-b0dec10d0d0fbc7f77623016f3d986122f718f8b.tar.gz mesa-b0dec10d0d0fbc7f77623016f3d986122f718f8b.tar.bz2 mesa-b0dec10d0d0fbc7f77623016f3d986122f718f8b.zip |
Fix crash when query a pbuffer surfacesubmit/tizen/20190507.001146accepted/tizen/unified/20190507.111915
Pbuffer is not created via TPL, so when query a pbuffer surface,
we can only call _eglQuerySurface instead of TPL APIs.
Change-Id: I55c7f4d06392198ae41ffd0a9d5dd23fb15bd532
-rw-r--r-- | src/egl/drivers/dri2/platform_tizen.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/src/egl/drivers/dri2/platform_tizen.c b/src/egl/drivers/dri2/platform_tizen.c index 0d33138e2e7..bd4594acd43 100644 --- a/src/egl/drivers/dri2/platform_tizen.c +++ b/src/egl/drivers/dri2/platform_tizen.c @@ -945,26 +945,28 @@ tizen_query_surface(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf, struct dri2_egl_surface *dri2_surf = dri2_egl_surface(surf); int width = 0, height = 0; - if (tpl_display_get_native_window_info(dri2_dpy->tpl_display, - dri2_surf->native_win, - &width, &height, NULL, 0, 0) != TPL_ERROR_NONE) - return EGL_FALSE; - - switch (attribute) { - case EGL_WIDTH: - if (dri2_surf->base.Type == EGL_WINDOW_BIT && dri2_surf->native_win) { - *value = width; - return EGL_TRUE; - } - break; - case EGL_HEIGHT: - if (dri2_surf->base.Type == EGL_WINDOW_BIT && dri2_surf->native_win) { - *value = height; - return EGL_TRUE; - } - break; - default: - break; + if (dri2_surf->base.Type == EGL_WINDOW_BIT) { + if (tpl_display_get_native_window_info(dri2_dpy->tpl_display, + dri2_surf->native_win, + &width, &height, NULL, 0, 0) != TPL_ERROR_NONE) + return EGL_FALSE; + + switch (attribute) { + case EGL_WIDTH: + if (dri2_surf->native_win) { + *value = width; + return EGL_TRUE; + } + break; + case EGL_HEIGHT: + if (dri2_surf->native_win) { + *value = height; + return EGL_TRUE; + } + break; + default: + break; + } } return _eglQuerySurface(drv, dpy, surf, attribute, value); } |