1
0
Fork 0

screen-cast-stream-src: Do not try to create a 0-sized texture when scaled

When the screen is scaled and we are recording/sharing the screen we may
end up crash as per trying to create a 0-sized texture due to missing
ceiling of the texture size.

This is similar to what was fixed in commit 4d4e8e5862 and the same
fix was included in commit 422ee4515, but hidden under a compilation fix

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3978>
This commit is contained in:
Marco Trevisan (Treviño) 2024-08-23 12:16:52 -04:00 committed by Marge Bot
parent 0d60d07204
commit 081b918bac

View file

@ -391,8 +391,8 @@ meta_screen_cast_stream_src_draw_cursor_into (MetaScreenCastStreamSrc *src,
texture_width = cogl_texture_get_width (cursor_texture);
texture_height = cogl_texture_get_height (cursor_texture);
width = texture_width * scale;
height = texture_height * scale;
width = ceilf (texture_width * scale);
height = ceilf (texture_height * scale);
if (texture_width == width &&
texture_height == height &&