mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-17 23:40:29 +01:00
egl/wayland/sw: clamp putimage geometry to surface size
this otherwise writes oob Acked-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703>
This commit is contained in:
parent
fa465e34ca
commit
c83768c76c
1 changed files with 3 additions and 0 deletions
|
|
@ -2463,6 +2463,9 @@ dri2_wl_swrast_put_image2(__DRIdrawable *draw, int op, int x, int y, int w,
|
|||
int h, int stride, char *data, void *loaderPrivate)
|
||||
{
|
||||
struct dri2_egl_surface *dri2_surf = loaderPrivate;
|
||||
/* clamp to surface size */
|
||||
w = MIN2(w, dri2_surf->base.Width);
|
||||
h = MIN2(h, dri2_surf->base.Height);
|
||||
int copy_width = dri2_wl_swrast_get_stride_for_format(dri2_surf->format, w);
|
||||
int dst_stride = dri2_wl_swrast_get_stride_for_format(dri2_surf->format,
|
||||
dri2_surf->base.Width);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue