Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pipewire: Properly pass sizes to gs_draw_sprite_subregion
The gs_draw_sprite_subregion() function is used when a cropping rectangle is received from PipeWire. It is usually used by compositors to implement window screencast - where a large and mostly empty frame is sent, the window contents are only a small part of it, and the crop rectangle tells us that. Recently the wlroots implementation of portals started to use it to implement cropping, and it exposed a bug in the PipeWire code in OBS Studio. The gs_draw_sprite_subregion() function takes a pair of floats representing position (x, y) and a pair of floats representing size (width, height). The PipeWire code, however, passes a second pair of positions (x2, y2) instead of sizes, and it causes overrendering the crop area. This bug wasn't hit yet because both GNOME and KDE implementations always send (0, 0) as position, which practically never trigger this condition. Pass only width and height to gs_draw_sprite_subregion(), instead of adding x and y to them. Fixes obsproject#4982
- Loading branch information