From: Seunghun Lee Date: Fri, 14 Mar 2025 03:45:12 +0000 (+0900) Subject: video: Handle exception on update input rectangle X-Git-Tag: accepted/tizen/unified/20250317.142111~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F08%2F321108%2F2;p=platform%2Fupstream%2Fenlightenment.git video: Handle exception on update input rectangle This adds an exception handling which was missed when the commit, 25d94c1f was applied. Change-Id: Ie18f0ec93bfdc8e3fec459fd57ca1696e0dac0f2 --- diff --git a/src/bin/displaymgr/video/e_video_hwc.c b/src/bin/displaymgr/video/e_video_hwc.c index cc0902f83e..b11c43630c 100644 --- a/src/bin/displaymgr/video/e_video_hwc.c +++ b/src/bin/displaymgr/video/e_video_hwc.c @@ -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);