Skip to content

Commit ce67e41

Browse files
committed
disp/vulkan_sdl2: fix crash on message
ported the commit ca04cb3 from vulkan_sdl3
1 parent b7e0eba commit ce67e41

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/video_display/vulkan/vulkan_sdl2.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* @author Martin Bela <492789@mail.muni.cz>
77
*/
88
/*
9-
* Copyright (c) 2018-2025 CESNET
9+
* Copyright (c) 2018-2026 CESNET, zájmové sdružení právnických osob
1010
* All rights reserved.
1111
*
1212
* Redistribution and use in source and binary forms, with or without
@@ -206,6 +206,7 @@ struct state_vulkan_sdl2 {
206206
explicit state_vulkan_sdl2(module* parent) {
207207
module_init_default(&mod);
208208
mod.new_message = display_vulkan_new_message;
209+
mod.priv_data = this;
209210
mod.cls = MODULE_CLASS_DATA;
210211
module_register(&mod, parent);
211212

@@ -973,7 +974,7 @@ bool display_vulkan_get_property(void* state, int property, void* val, size_t* l
973974
}
974975

975976
void display_vulkan_new_message(module* mod) {
976-
auto s = reinterpret_cast<state_vulkan_sdl2*>(mod);
977+
auto s = reinterpret_cast<state_vulkan_sdl2*>(mod->priv_data);
977978
assert(s->magic == magic_vulkan_sdl2);
978979

979980
SDL_Event event{};

0 commit comments

Comments
 (0)