From ca04cb3e38b1a8d06f83420342f200fbd6916303 Mon Sep 17 00:00:00 2001 From: Martin Piatka Date: Fri, 2 Jan 2026 10:56:48 +0100 Subject: [PATCH] disp/vulkan: Fix crash on module message It was trying to get the state pointer from the module pointer, but the module isn't the first member in state. --- src/video_display/vulkan/vulkan_sdl3.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video_display/vulkan/vulkan_sdl3.cpp b/src/video_display/vulkan/vulkan_sdl3.cpp index 297c2cf50..34ee09e2e 100644 --- a/src/video_display/vulkan/vulkan_sdl3.cpp +++ b/src/video_display/vulkan/vulkan_sdl3.cpp @@ -201,6 +201,7 @@ struct state_vulkan_sdl3 { module_init_default(&mod); mod.new_message = display_vulkan_new_message; mod.cls = MODULE_CLASS_DATA; + mod.priv_data = this; module_register(&mod, parent); sdl_user_new_message_event = SDL_RegisterEvents(1); @@ -1002,7 +1003,7 @@ bool display_vulkan_get_property(void* state, int property, void* val, size_t* l } void display_vulkan_new_message(module* mod) { - auto s = reinterpret_cast(mod); + auto s = reinterpret_cast(mod->priv_data); assert(s->magic == magic_vulkan_sdl3); SDL_Event event{};