From 17603546544a0d9095b4265a7283e745b4430d67 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Tue, 23 Apr 2024 17:45:23 -0400 Subject: [PATCH] fix: capture dimensions must be > 0 --- cosmic-app-list/src/wayland_handler.rs | 4 ++++ cosmic-applet-minimize/src/wayland_handler.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/cosmic-app-list/src/wayland_handler.rs b/cosmic-app-list/src/wayland_handler.rs index de89d768..b34edb3d 100644 --- a/cosmic-app-list/src/wayland_handler.rs +++ b/cosmic-app-list/src/wayland_handler.rs @@ -401,6 +401,10 @@ impl CaptureData { .unwrap(); let (width, height) = formats.buffer_size; + if width == 0 || height == 0 { + return None; + } + // XXX if !formats .shm_formats diff --git a/cosmic-applet-minimize/src/wayland_handler.rs b/cosmic-applet-minimize/src/wayland_handler.rs index 15636a77..a98c2539 100644 --- a/cosmic-applet-minimize/src/wayland_handler.rs +++ b/cosmic-applet-minimize/src/wayland_handler.rs @@ -167,6 +167,10 @@ impl CaptureData { .unwrap(); let (width, height) = formats.buffer_size; + if width == 0 || height == 0 { + return None; + } + // XXX if !formats .shm_formats