mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-30 20:10:24 +01:00
egl/wayland: Don't try to access modifiers u_vector as dynarray
The modifiers are u_vectors, but the code was trying to access them as dynarrays. This resulted in a wrong number of modifiers, which then later on would also lead to invalid reads used as modifiers. In the case of the iris driver, a wrongly read number of modifiers > 0 would also trigger an error message. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6643 Fixes:b5848b2dac("egl/wayland: use surface dma-buf feedback to allocate surface buffers") Reviewed-by: Leandro Ribeiro <leandro.ribeiro@collabora.com> Reviewed-by: Simon Ser <contact@emersion.fr> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17180> (cherry picked from commitf50fe9b0b6)
This commit is contained in:
parent
800651daf3
commit
50cd036871
2 changed files with 3 additions and 4 deletions
|
|
@ -391,7 +391,7 @@
|
|||
"description": "egl/wayland: Don't try to access modifiers u_vector as dynarray",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "b5848b2dac1464f5364dc2a76bd11cac0cb5769b"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -937,9 +937,8 @@ create_dri_image_from_dmabuf_feedback(struct dri2_egl_surface *dri2_surf,
|
|||
/* Ignore tranches that do not contain dri2_surf->format */
|
||||
if (!BITSET_TEST(tranche->formats.formats_bitmap, visual_idx))
|
||||
continue;
|
||||
modifiers = util_dynarray_begin(&tranche->formats.modifiers[visual_idx]);
|
||||
num_modifiers = util_dynarray_num_elements(&tranche->formats.modifiers[visual_idx],
|
||||
uint64_t);
|
||||
modifiers = u_vector_tail(&tranche->formats.modifiers[visual_idx]);
|
||||
num_modifiers = u_vector_length(&tranche->formats.modifiers[visual_idx]);
|
||||
|
||||
/* For the purposes of this function, an INVALID modifier on
|
||||
* its own means the modifiers aren't supported. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue