[Scummvm-git-logs] scummvm master -> ce19a2340b485e575f756aeabd9bc7e43e20b14e
spleen1981
noreply at scummvm.org
Sat Jul 25 23:08:44 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
ce19a2340b LIBRETRO: Guard NULL g_system when changing gui_h_res / aspect
Commit: ce19a2340b485e575f756aeabd9bc7e43e20b14e
https://github.com/scummvm/scummvm/commit/ce19a2340b485e575f756aeabd9bc7e43e20b14e
Author: AlbertoVelazquez (50219414+AlbertoVelazquez at users.noreply.github.com)
Date: 2026-07-26T01:08:41+02:00
Commit Message:
LIBRETRO: Guard NULL g_system when changing gui_h_res / aspect
update_variables() runs from retro_init() before g_system is assigned,
but the USE_HIGHRES block dereferences LIBRETRO_G_SYSTEM->inLauncher().
It only crashed when the option differed from its default, because
otherwise the new_value != current comparison short-circuits the &&
before the deref. Add a NULL guard; gui_height/gui_width are still
recorded, so the launcher resolution still applies once g_system
exists. Fixes the SIGSEGV on setting a non-default scummvm_gui_h_res
or scummvm_gui_aspect_ratio.
Changed paths:
backends/platform/libretro/src/libretro-core.cpp
diff --git a/backends/platform/libretro/src/libretro-core.cpp b/backends/platform/libretro/src/libretro-core.cpp
index 2a59b2a8553..57ceb5ba30f 100644
--- a/backends/platform/libretro/src/libretro-core.cpp
+++ b/backends/platform/libretro/src/libretro-core.cpp
@@ -512,7 +512,7 @@ static void update_variables(void) {
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
uint16 new_gui_height = (int)atoi(var.value);
- av_status |= new_gui_height != gui_height && LIBRETRO_G_SYSTEM->inLauncher() ? AV_STATUS_UPDATE_GUI : 0;
+ av_status |= new_gui_height != gui_height && LIBRETRO_G_SYSTEM && LIBRETRO_G_SYSTEM->inLauncher() ? AV_STATUS_UPDATE_GUI : 0;
gui_height = new_gui_height;
}
@@ -526,7 +526,7 @@ static void update_variables(void) {
den = 9;
}
uint16 new_gui_width = gui_height * num / den + (gui_height * num % den != 0);
- av_status |= (new_gui_width != gui_width) && LIBRETRO_G_SYSTEM->inLauncher() ? AV_STATUS_UPDATE_GUI : 0;
+ av_status |= (new_gui_width != gui_width) && LIBRETRO_G_SYSTEM && LIBRETRO_G_SYSTEM->inLauncher() ? AV_STATUS_UPDATE_GUI : 0;
gui_width = new_gui_width;
}
#endif
More information about the Scummvm-git-logs
mailing list