Merge pull request #22275 from hrydgard/scemp4-review-fixes

sceMp4: Read the effective flags (not the config), don't reload the modules by accident
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2026-09-09 19:32:10 -06:00
commit a52b11aa2e
2 files changed
+7 -5

No files matched your search

+3 -1
View File
@@ -2835,7 +2835,9 @@ struct GetModuleIdByAddressArg
// needs the callee's gp in place. libmp4.prx uses it on the three callbacks it is given.
// Named after what it does; the official name isn't known.
static u32 sceKernelGetModuleGPByAddress(u32 addr, u32 gpPtr) {
if (!Memory::IsValidAddress(gpPtr)) {
// Four bytes get written, so check for four - IsValidAddress would pass on the last three
// bytes of a region.
if (!Memory::IsValidRange(gpPtr, 4)) {
return hleLogError(Log::sceModule, SCE_KERNEL_ERROR_ILLEGAL_ADDR, "bad gp pointer");
}
+4 -4
View File
@@ -92,7 +92,10 @@ static void NotifyLoadStatusAvcodec(int state, u32 loadAddr, u32 totalSize) {
static SceUID g_mp4RealModules[2] = { 0, 0 };
static void NotifyLoadStatusMp4(int state, u32 loadAddr, u32 totalSize) {
if (!((DisableHLEFlags)g_Config.iDisableHLE & DisableHLEFlags::sceMp4)) {
// The effective flags, not the raw setting: those also account for a firmware dump that isn't
// there or is too old to have sceMp4 (which is the whole point of CheckDisableHLEAvailability),
// for the compat flags.
if (!(GetEffectiveDisableHLEFlags() & DisableHLEFlags::sceMp4)) {
return;
}
@@ -122,9 +125,6 @@ static void NotifyLoadStatusMp4(int state, u32 loadAddr, u32 totalSize) {
g_mp4RealModules[i] = id;
INFO_LOG(Log::sceUtility, "Loaded the real %s", paths[i]);
}
} else if (state == -1) {
g_mp4RealModules[0] = 0;
g_mp4RealModules[1] = 0;
}
}