tpl_wayland_egl_thread: Fixed referencing the wrong pointer. 07/210507/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Mon, 22 Jul 2019 04:20:45 +0000 (13:20 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Mon, 22 Jul 2019 04:20:45 +0000 (13:20 +0900)
Change-Id: I89705ebaa38092bb925b2d2599df3854c174b5f6
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl_thread.c

index 1714b38..f3c361f 100644 (file)
@@ -1190,11 +1190,15 @@ __cb_get_rotation_capability(struct wl_egl_window *wl_egl_window,
        TPL_ASSERT(wl_egl_window);
 
        int rotation_capability = WL_EGL_WINDOW_TIZEN_CAPABILITY_NONE;
-       twe_wl_surf_source *source = (twe_wl_surf_source *)private;
-       if (source->rotation_capability == TPL_TRUE)
-               rotation_capability = WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_SUPPORTED;
-       else
-               rotation_capability = WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_UNSUPPORTED;
+       struct tizen_private *tizen_private = (struct tizen_private *)private;
+
+       if (tizen_private->data) {
+               twe_wl_surf_source *source = (twe_wl_surf_source *)tizen_private->data;
+               if (source->rotation_capability == TPL_TRUE)
+                       rotation_capability = WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_SUPPORTED;
+               else
+                       rotation_capability = WL_EGL_WINDOW_TIZEN_CAPABILITY_ROTATION_UNSUPPORTED;
+       }
 
        return rotation_capability;
 }
@@ -1206,12 +1210,17 @@ __cb_set_window_serial_callback(struct wl_egl_window *wl_egl_window,
        TPL_ASSERT(private);
        TPL_ASSERT(wl_egl_window);
 
-       twe_wl_surf_source *source = (twe_wl_surf_source *)private;
+       struct tizen_private *tizen_private = (struct tizen_private *)private;
+
+       if (tizen_private->data) {
+               twe_wl_surf_source *source = (twe_wl_surf_source *)tizen_private->data;
 
-       source->set_serial_is_used = TPL_TRUE;
-       source->serial = serial;
+               source->set_serial_is_used = TPL_TRUE;
+               source->serial = serial;
+       }
 }
 
+
 static void __cb_tss_flusher_flush_callback(void *data,
                struct tizen_surface_shm_flusher *tss_flusher)
 {