egl/wayland: fix oob buffer access during buffer_fds clean up
After iterating through the number of planes in the above for
loop i is more than the number of planes which corresponds to
the size of the buffer_fds array.
Fixes: 967b9ad084 ("egl/wayland: for prime, allocate linear_copy from display GPU VRAM")
Signed-off-by: David Redondo <kde@david-redondo.de>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22496>
This commit is contained in:
@@ -1121,10 +1121,10 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
|
||||
&strides[0],
|
||||
&offsets[0],
|
||||
dri2_surf->back);
|
||||
do {
|
||||
for (i = 0; i < num_planes; ++i) {
|
||||
if (buffer_fds[i] != -1)
|
||||
close(buffer_fds[i]);
|
||||
} while (--i >= 0);
|
||||
}
|
||||
dri2_dpy->image->destroyImage(linear_copy_display_gpu_image);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user