From 48f70fbf10cdcefcb4ce5c374f8daa643f62e4fe Mon Sep 17 00:00:00 2001 From: Eladash Date: Fri, 28 Aug 2020 00:42:46 +0300 Subject: [PATCH] Fix UB in Emulator::Load --- rpcs3/Emu/System.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 6b4902d0e7..5b3e4abbb3 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -1442,7 +1442,8 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool if (!disc_sfo_dir.empty() && fs::is_file(disc_sfo_dir)) { - const auto bdvd_title = psf::get_string(psf::load_object(fs::file{ disc_sfo_dir }), "TITLE"); + const auto psf_obj = psf::load_object(fs::file{ disc_sfo_dir }); + const auto bdvd_title = psf::get_string(psf_obj, "TITLE"); if (!bdvd_title.empty() && bdvd_title != m_title) {