video: Fix crash when commit video buffer with deleted E_Client 69/252969/3 accepted/tizen/unified/20210204.041558 submit/tizen/20210203.114639
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 3 Feb 2021 11:05:36 +0000 (20:05 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Wed, 3 Feb 2021 11:34:20 +0000 (20:34 +0900)
With change 32a04d07, this crash was made since null buffer can be
given to _e_video_hwc_windows_commit_data_set().
Accessing comp_data of deleted E_Client caused a crash.

Change-Id: Icaa8e0022a8d81c51f611a0180f65112479979bf

src/bin/video/iface/e_video_hwc.c
src/bin/video/iface/e_video_hwc_windows.c

index 45a24c0..d517ebf 100644 (file)
@@ -1995,12 +1995,16 @@ e_video_hwc_client_mask_update(E_Video_Hwc *evh)
    Eina_Bool punch = EINA_FALSE;
    int bw, bh;
 
+   if (e_object_is_del(E_OBJECT(evh->ec)))
+     return;
+
    if (e_video_debug_punch_value_get())
      punch = EINA_TRUE;
    else if ((topmost = e_comp_wl_topmost_parent_get(evh->ec)))
      {
         /* if it's laid above main surface */
-        if (eina_list_data_find(topmost->comp_data->sub.list, evh->ec))
+        if ((topmost->comp_data) &&
+            (eina_list_data_find(topmost->comp_data->sub.list, evh->ec)))
           punch = EINA_TRUE;
         /* if it's laid under main surface and main surface is transparent */
         else if (topmost->argb)
index fc00c01..e4d0823 100644 (file)
@@ -82,7 +82,8 @@ end:
        " dst(%d,%d, %dx%d), transform(%d)",
        e_client_util_name_get(evhw->base.ec) ?: "No Name" ,
        evhw->base.ec->netwm.pid,
-       wl_resource_get_id(evhw->base.ec->comp_data->surface),
+       (evhw->base.ec->comp_data ?
+        wl_resource_get_id(evhw->base.ec->comp_data->surface) : -1),
        vbuf, (vbuf ? vbuf->ref_cnt : 0),
        evhw->commit_data.info.src_config.size.h,
        evhw->commit_data.info.src_config.size.v,