video: Handle exception on update input rectangle 08/321108/2
authorSeunghun Lee <shiin.lee@samsung.com>
Fri, 14 Mar 2025 03:45:12 +0000 (12:45 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Fri, 14 Mar 2025 04:25:54 +0000 (04:25 +0000)
This adds an exception handling which was missed when the commit,
25d94c1f was applied.

Change-Id: Ie18f0ec93bfdc8e3fec459fd57ca1696e0dac0f2

src/bin/displaymgr/video/e_video_hwc.c

index cc0902f83e67a44d61168c43f8c5d7d4aa206b07..b11c43630c850c8e814da0be1e8110bca371af2b 100644 (file)
@@ -1540,12 +1540,14 @@ _e_video_hwc_comp_buffer_tbm_format_get(E_Comp_Wl_Buffer *comp_buffer)
    return tbm_surface_get_format(tbm_surf);
 }
 
-static void
+static Eina_Bool
 _e_video_hwc_geometry_input_rect_get_with_viewport(E_Surface *surface, Eina_Rectangle *out)
 {
    struct ds_fbox source_box;
 
    e_surface_buffer_source_box_get(surface, &source_box);
+   if (source_box.width == 0.0 || source_box.height == 0.0)
+     return EINA_FALSE;
 
    out->x = (int)source_box.x;
    out->y = (int)source_box.y;
@@ -1553,6 +1555,8 @@ _e_video_hwc_geometry_input_rect_get_with_viewport(E_Surface *surface, Eina_Rect
    out->h = (int)source_box.height;
 
    VIN("buffer source box(%d %d %d %d)", e_surface_ec_get(surface), out->x, out->y, out->w, out->h);
+
+   return EINA_TRUE;
 }
 
 static void
@@ -1582,7 +1586,12 @@ _e_video_hwc_geometry_viewport_apply(E_Client *ec, E_Video_Hwc_Geometry *out)
 {
    E_Surface *surface = e_surface_from_ec(ec);
 
-   _e_video_hwc_geometry_input_rect_get_with_viewport(surface, &out->input_r);
+   if (!_e_video_hwc_geometry_input_rect_get_with_viewport(surface, &out->input_r))
+     {
+        VER("Failed to get input rectangle", ec);
+        return EINA_FALSE;
+     }
+
    _e_video_hwc_geometry_output_rect_get(ec, &out->output_r);
    out->transform = e_surface_buffer_transform_get(surface);