Skip to content

backend-wayland: fix pixman buffer size

Pekka Paalanen requested to merge pq/weston:mr/wayfix into main

As wayland-backend is blitting the output decorations into the output buffer itself, it pretends towards the pixman-renderer that there is no decorations area. The pixman_image_create_bits() call wraps the previously allocated buffer with an offset so that pixman-renderer will paint in the right position.

The bug is that this pixman image was using the original buffer width and height, instead of the composited area width and height. So the pixman image looks too big to pixman-renderer, but the renderer didn't care. The image being too big does risk access out of bounds in pixman-renderer.

I found this when I was making renderers explicitly aware of the frambuffer size and resizing, added asserts, and they surprisingly failed. This fixes that.

Merge request reports