ecore_wl2: prevent wrong use of wtz_exported_shell_set_destination 61/275461/3
authorShinwoo Kim <cinoo.kim@samsung.com>
Wed, 25 May 2022 06:51:26 +0000 (15:51 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Mon, 20 Jun 2022 02:09:51 +0000 (02:09 +0000)
It is an error if you are using wtz_exported_shell_set_destination
with negative or zero values.

Please refer to following description.

[wtz_foreign.xml]
  <interface name="wtz_exported_shell" version="1">
    <description summary="an exported shell handle">
    ...
    </description>
    <enum name="error">
      <entry name="bad_value" value="0"
         summary="negative or zero values in width or height"/>

Change-Id: Iea52527c9bd2c51b2f260464443af1437837ef17

src/lib/ecore_wl2/ecore_wl2_subsurf.c

index 48c2c46..6f28496 100644 (file)
@@ -385,6 +385,9 @@ ecore_wl2_subsurface_exported_surface_resize(Ecore_Wl2_Subsurface *subsurface, i
 {
    EINA_SAFETY_ON_NULL_RETURN(subsurface);
    EINA_SAFETY_ON_NULL_RETURN(subsurface->wl.fs);
+
+   if (w <= 0 || h <= 0) return;
+
    wtz_exported_shell_set_destination(subsurface->wl.fs, w, h);
 }