mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-16 06:48:31 +02:00
loader: fix UB in wayland helper code.
The wayland helper will use uninitialized data, causing undefined behaviour. This was because the feedback data was allocated, but not fully initialized. After the fix, SDL's vulkantest runs cleanly through valgrind. Before, it would not. Signed-off-by: Bram Stolk <b.stolk@gmail.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39133>
This commit is contained in:
parent
c05d276473
commit
3d8286d7c8
1 changed files with 2 additions and 1 deletions
|
|
@ -412,7 +412,8 @@ loader_wayland_presentation_feedback(struct loader_wayland_presentation *pres,
|
|||
!tracing)
|
||||
return;
|
||||
|
||||
fd = malloc(sizeof *fd);
|
||||
fd = calloc(1, sizeof *fd);
|
||||
|
||||
fd->presentation = pres;
|
||||
fd->tracing = tracing;
|
||||
if (tracing) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue