subsurface: Fix dereferencing before null check 40/318140/1
authorSeunghun Lee <shiin@samsung.com>
Wed, 25 Sep 2024 03:40:15 +0000 (12:40 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 25 Sep 2024 04:22:18 +0000 (13:22 +0900)
Change-Id: Iebce171754c8ef4cd3aa220c7740b6208bf68c31

src/bin/server/e_comp_wl_subsurface.c

index 6006d7a9f28364987da0c8f148a202971324063c..563c81a60d20fbaadd34c20056da69222433e414 100644 (file)
@@ -69,19 +69,22 @@ _e_comp_wl_client_subsurface_parent_set(E_Client *ec, E_Client *parent)
 
    sdata->parent = parent;
 
-   if (parent->frame)
+   if (parent)
      {
-        layer = e_client_layer_get(parent);
-        if (layer > E_LAYER_BOTTOM)
-          e_client_layer_set(ec, layer);
-     }
+        if (parent->frame)
+          {
+             layer = e_client_layer_get(parent);
+             if (layer > E_LAYER_BOTTOM)
+               e_client_layer_set(ec, layer);
+          }
 
-   if (parent->comp_data)
-     {
-        /* append this client to the parents subsurface list */
-        parent->comp_data->sub.list_pending =
-           eina_list_append(parent->comp_data->sub.list_pending, ec);
-        parent->comp_data->sub.list_changed = EINA_TRUE;
+        if (parent->comp_data)
+          {
+             /* append this client to the parents subsurface list */
+             parent->comp_data->sub.list_pending =
+                eina_list_append(parent->comp_data->sub.list_pending, ec);
+             parent->comp_data->sub.list_changed = EINA_TRUE;
+          }
      }
 }