mutter/src/backends
Georges Basile Stavracas Neto 4d4e8e5862 screen-cast/src: Ceil cursor buffer size
meta_screen_cast_stream_src_set_cursor_sprite_metadata() receives
the cursor sprite, position, and scale, and with that it downloads
the cursor sprite by drawing it into a separate framebuffer, then
calls cogl_framebuffer_read_pixels() in it - this is the offscren
path that is very common when using screen capturing applications
such as OBS Studio.

There's a sneaky issue in this code path though: the 'scale' value
is a float. The cursor size is then determined by multiplying the
sprite width and height - two integer variables - by scale, and
this relies on standard float-to-int conversions. This is problematic
as sometimes the rounded values disagree with what is expected by
cogl_framebuffer_read_pixels(). If the packing of either the cursor
width or height is off by one, glReadPixels() will try to write into
off bounds, which crashes.

This can be reproduced by enabling fractional scaling, setting a 150%
zoom level, on a 4K screen, and opening any commit with an image diff
in gitlab.gnome.org, all while screencasting. When hovering the new
image, the cursor sprite will be such that it triggers this code path,
and reproduces this issue.

Fix this by always ceiling the cursor sprite sizes.

Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/2542

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2736>
2022-12-03 09:25:52 -03:00
..
native kms/connector: Don't query the kernel twice when updating 2022-11-24 16:18:22 +00:00
x11 x11/cm: Stop using intermediate bypass_clutter variable 2022-11-24 12:25:29 +00:00
edid-parse.c edid: Parse CTA-861 HDR Static Metadata Data Block 2022-07-04 14:54:11 +00:00
edid.h tests/edid: Test EDID CTA-861 parsing code 2022-07-04 14:54:11 +00:00
gsm-inhibitor-flag.h
meta-backend-private.h context: Add 'started' and 'prepare-shutdown' signals 2022-11-25 10:26:52 +00:00
meta-backend-types.h crtc: Get/set gamma via helper struct 2022-09-01 17:52:01 +02:00
meta-backend.c context: Add 'started' and 'prepare-shutdown' signals 2022-11-25 10:26:52 +00:00
meta-barrier-private.h barrier: Modernize type implementation 2022-07-26 20:27:24 +00:00
meta-barrier.c barrier: Make type derivable again 2022-09-15 12:27:52 +00:00
meta-color-device.c color-device: Clear pending flags always when finished 2022-09-29 13:41:17 +00:00
meta-color-device.h color-device: Add API to set test efivar path 2022-09-01 21:09:28 +00:00
meta-color-manager-private.h tests: Add duplicate color profile test case 2022-09-15 11:22:54 +00:00
meta-color-manager.c color: Emit signal when device is updated 2022-09-01 17:52:01 +02:00
meta-color-manager.h x11: Add X11 color manager subclass 2022-09-01 19:09:21 +02:00
meta-color-profile.c color: Handle profiles not initializing succesfully 2022-09-15 11:22:54 +00:00
meta-color-profile.h color-device: Pass calibration state separately when creating profile 2022-09-01 21:09:28 +00:00
meta-color-store.c tests: Add duplicate color profile test case 2022-09-15 11:22:54 +00:00
meta-color-store.h tests: Add duplicate color profile test case 2022-09-15 11:22:54 +00:00
meta-crtc-mode.c
meta-crtc-mode.h output/kms: Replace common mode bandwidth check with clock check 2022-07-01 16:13:18 +02:00
meta-crtc.c crtc: Get/set gamma via helper struct 2022-09-01 17:52:01 +02:00
meta-crtc.h crtc: Get/set gamma via helper struct 2022-09-01 17:52:01 +02:00
meta-cursor-renderer.c stage: Implement buffer-transform support in MetaOverlay 2022-08-05 20:30:50 +02:00
meta-cursor-renderer.h cursor-renderer: Remove meta_cursor_renderer_is_overlay_visible 2021-09-20 14:00:08 +00:00
meta-cursor-sprite-xcursor.c cursor-sprite: Register all cursor sprites with the cursor tracker 2021-12-22 16:22:08 +00:00
meta-cursor-sprite-xcursor.h cursor-sprite: Register all cursor sprites with the cursor tracker 2021-12-22 16:22:08 +00:00
meta-cursor-tracker-private.h cursor-sprite: Register all cursor sprites with the cursor tracker 2021-12-22 16:22:08 +00:00
meta-cursor-tracker.c cursor-tracker: Add missing annotation to meta_cursor_tracker_get_pointer 2022-04-05 14:05:22 +02:00
meta-cursor.c cursor: Hold reference to cursor tracker 2021-12-22 19:37:16 +01:00
meta-cursor.h backends: Replace MetaCursorSprite::prepare-at with in-place function 2021-12-07 20:04:08 +00:00
meta-dbus-session-watcher.c
meta-dbus-session-watcher.h
meta-display-config-shared.h
meta-dnd-private.h dnd: Notify about events during compositor grab from event filter 2022-03-02 15:12:23 +00:00
meta-egl-ext.h
meta-egl.c egl: Fix number of configs returned in meta_egl_choose_all_configs 2022-03-03 08:18:56 +00:00
meta-egl.h egl: Add eglQueryDisplayAttribEXT() helper 2022-01-05 16:36:48 +00:00
meta-gles3-table.h
meta-gles3.c
meta-gles3.h
meta-gpu.c
meta-gpu.h
meta-idle-manager.c context: Move 'replace-current-wm' tracking to the context 2021-07-15 11:34:37 +02:00
meta-idle-manager.h backends: Introduce MetaIdleManager 2021-05-18 13:19:36 +00:00
meta-idle-monitor-private.h backends: Introduce MetaIdleManager 2021-05-18 13:19:36 +00:00
meta-idle-monitor.c Name unnamed sources 2022-03-04 10:10:05 +03:00
meta-input-device-private.h
meta-input-device.c backends: move 'input_device' to HAVE_LIBWACOM scope 2020-05-03 23:35:03 +01:00
meta-input-mapper-private.h backends: Expose InputMapping D-Bus path to determine tablet mapping 2022-09-02 18:34:36 +00:00
meta-input-mapper.c backends: Use Clutter API to get dimensions at MetaInputMapper 2022-11-09 10:46:55 +00:00
meta-input-settings-dummy.c backends: Drop MetaInputSettings vfunc to figure out trackballs 2022-11-09 10:46:55 +00:00
meta-input-settings-dummy.h backends/x11: Add dummy input-settings implementation 2021-03-10 13:56:54 +00:00
meta-input-settings-private.h backends: Drop MetaInputSettings vfunc to figure out trackballs 2022-11-09 10:46:55 +00:00
meta-input-settings.c backends: Use capabilities to figure out trackballs in MetaInputSettings 2022-11-09 10:46:55 +00:00
meta-keymap-utils.c
meta-keymap-utils.h compositor: use XDG_CONFIG_HOME as initial lookup path for xkb 2020-06-08 11:29:30 +00:00
meta-logical-monitor.c
meta-logical-monitor.h *: Fix spelling mistakes found by codespell 2020-08-29 09:10:31 +00:00
meta-monitor-config-manager.c monitor-config-manager: Add a max_bpc field to MetaMonitorConfig 2022-08-19 17:07:12 +00:00
meta-monitor-config-manager.h monitor-config-manager: Add a max_bpc field to MetaMonitorConfig 2022-08-19 17:07:12 +00:00
meta-monitor-config-migration.c monitor-manager: Pass the Logical mode when computing the monitor scale 2021-07-22 13:14:01 +02:00
meta-monitor-config-migration.h
meta-monitor-config-store.c monitor-config-store: Format <rate> using the C locale (. decimal point) 2022-09-02 08:43:00 +00:00
meta-monitor-config-store.h monitor-config-store: Allow changing D-Bus configuration policy 2022-01-25 16:25:48 +00:00
meta-monitor-manager-dummy.c Remove meta_is_stage_views_enabled() 2022-09-19 14:46:01 +00:00
meta-monitor-manager-dummy.h
meta-monitor-manager-private.h crtc: Get/set gamma via helper struct 2022-09-01 17:52:01 +02:00
meta-monitor-manager.c monitor: Keep the dbus night-light-supported property in sync 2022-09-19 15:13:12 +00:00
meta-monitor-transform.c monitor-transform: Add helper to transform matrices 2022-08-05 20:30:50 +02:00
meta-monitor-transform.h monitor-transform: Add helper to transform matrices 2022-08-05 20:30:50 +02:00
meta-monitor.c crtc: Get/set gamma via helper struct 2022-09-01 17:52:01 +02:00
meta-monitor.h tests/color: Test that we handle devices with no GAMMA_LUT 2022-09-03 14:41:36 +00:00
meta-orientation-manager.c backend: Check if the gsettings scheme exists 2022-05-17 11:24:07 +02:00
meta-orientation-manager.h tests: Add MetaOrientationManager tests via SensorsProxy mock 2021-09-04 10:04:00 +02:00
meta-output.c output: Keep the EDID struct with the other output info 2022-09-01 16:54:04 +02:00
meta-output.h output: Keep the EDID struct with the other output info 2022-09-01 16:54:04 +02:00
meta-pointer-constraint.c pointer-constraints: Move min edge distance from backend to Wayland 2022-06-13 18:38:50 +00:00
meta-pointer-constraint.h pointer-constraints: Move min edge distance from backend to Wayland 2022-06-13 18:38:50 +00:00
meta-remote-access-controller-private.h
meta-remote-access-controller.c
meta-remote-desktop-session.c remote-desktop: Check pipe fd before assuming existing read() operation 2021-07-28 15:26:04 +00:00
meta-remote-desktop-session.h remote-desktop/session: Add support for SelectionTransfer/Write 2021-02-05 16:44:27 +00:00
meta-remote-desktop.c remote-desktop: Close sessions on prepare-shutdown 2021-05-11 16:18:13 +00:00
meta-remote-desktop.h remote-desktop: Add backend getter 2021-03-04 17:39:08 +00:00
meta-renderer-view.c renderer-view: Use common helper function to transform matrices 2022-09-01 20:40:35 +00:00
meta-renderer-view.h backends: Excise MetaStageView to its own file 2021-07-16 19:08:06 +02:00
meta-renderer.c renderer: Cleanup views in dispose 2021-05-05 19:52:04 +00:00
meta-renderer.h tests/monitor: Check that the CRTC "layout" is correct 2021-01-22 16:47:08 +00:00
meta-screen-cast-area-stream-src.c screencast: Implement buffer-transform support 2022-08-05 20:30:50 +02:00
meta-screen-cast-area-stream-src.h
meta-screen-cast-area-stream.c remote-desktop/session: Handle unable to transform coordinate gracefully 2021-03-12 15:09:45 +00:00
meta-screen-cast-area-stream.h screen-cast: Add screen cast flag to streams 2020-07-30 09:51:16 +02:00
meta-screen-cast-monitor-stream-src.c screencast: Implement buffer-transform support 2022-08-05 20:30:50 +02:00
meta-screen-cast-monitor-stream-src.h
meta-screen-cast-monitor-stream.c screen-cast-stream: Embed the wayland output name to streams 2022-08-15 17:01:27 +00:00
meta-screen-cast-monitor-stream.h
meta-screen-cast-session.c screen-cast-session: Add is-active tracking 2021-12-07 19:23:52 +00:00
meta-screen-cast-session.h screen-cast-session: Add is-active tracking 2021-12-07 19:23:52 +00:00
meta-screen-cast-stream-src.c screen-cast/src: Ceil cursor buffer size 2022-12-03 09:25:52 -03:00
meta-screen-cast-stream-src.h screencast: Implement buffer-transform support 2022-08-05 20:30:50 +02:00
meta-screen-cast-stream.c ScreenCast: Allow recording new streams on active sessions 2021-12-07 19:23:52 +00:00
meta-screen-cast-stream.h remote-desktop/session: Handle unable to transform coordinate gracefully 2021-03-12 15:09:45 +00:00
meta-screen-cast-virtual-stream-src.c virtual-stream: Paint stage properly with/without cursor 2022-10-24 19:38:08 +00:00
meta-screen-cast-virtual-stream-src.h screen-cast/session: Introduce RecordVirtual D-Bus API 2021-03-12 15:09:45 +00:00
meta-screen-cast-virtual-stream.c remote-desktop/virtual: Drop absolute events if not active 2022-03-04 18:13:45 +00:00
meta-screen-cast-virtual-stream.h screen-cast/session: Introduce RecordVirtual D-Bus API 2021-03-12 15:09:45 +00:00
meta-screen-cast-window-stream-src.c screencast: Implement buffer-transform support 2022-08-05 20:30:50 +02:00
meta-screen-cast-window-stream-src.h
meta-screen-cast-window-stream.c remote-desktop/session: Handle unable to transform coordinate gracefully 2021-03-12 15:09:45 +00:00
meta-screen-cast-window-stream.h
meta-screen-cast-window.c screencast: Implement buffer-transform support 2022-08-05 20:30:50 +02:00
meta-screen-cast-window.h screencast: Implement buffer-transform support 2022-08-05 20:30:50 +02:00
meta-screen-cast.c screen-cast: Remove stray newline 2022-04-29 18:58:38 +00:00
meta-screen-cast.h screen-cast/session: Introduce RecordVirtual D-Bus API 2021-03-12 15:09:45 +00:00
meta-settings-private.h backend/native: Only disable dmabuf screen cast when not hw accelerated 2022-02-07 19:16:45 +00:00
meta-settings.c ui: Excise old frames UI 2022-12-01 20:10:53 +00:00
meta-stage-impl-private.h stage-impl: Change the backend pointer to MetaBackend 2022-01-17 09:48:51 +01:00
meta-stage-impl.c stage: Paint the untransformed swap region 2022-09-20 17:49:10 +00:00
meta-stage-private.h stage: Implement buffer-transform support in MetaOverlay 2022-08-05 20:30:50 +02:00
meta-stage-view-private.h backends: Excise MetaStageView to its own file 2021-07-16 19:08:06 +02:00
meta-stage-view.c backends: Excise MetaStageView to its own file 2021-07-16 19:08:06 +02:00
meta-stage.c stage: Mark stage as active on wayland when it has key-focus 2022-08-24 10:00:22 +00:00
meta-viewport-info.c main: Move rect related macro to util-private.h 2021-05-17 16:08:42 +00:00
meta-viewport-info.h backends: Store whether views are scaled in MetaViewportInfo 2021-04-13 10:32:14 +00:00
meta-virtual-monitor.c virtual-monitor: Add way to change virtual monitor mode 2022-03-04 18:13:45 +00:00
meta-virtual-monitor.h tests/runner: Add 'resize_monitor' metatest command 2022-08-11 11:32:42 +00:00