mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-11 00:29:37 +01:00
Merge pull request #14728 from unknownbrackets/dialog-bad-start
Dialog: Avoid crash with hacked dialog start
This commit is contained in:
2 files changed
+9
-1
No files matched your search
@@ -121,10 +121,12 @@ void PSPDialog::ChangeStatusInit(int delayUs) {
|
||||
}
|
||||
|
||||
void PSPDialog::ChangeStatusShutdown(int delayUs) {
|
||||
// If we're doing shutdown right away and skipped start, we don't run the dialog thread.
|
||||
bool skipDialogShutdown = status == SCE_UTILITY_STATUS_NONE;
|
||||
ChangeStatus(SCE_UTILITY_STATUS_SHUTDOWN, 0);
|
||||
|
||||
auto params = GetCommonParam();
|
||||
if (params)
|
||||
if (params && !skipDialogShutdown)
|
||||
UtilityDialogShutdown(DialogType(), delayUs, params->accessThread);
|
||||
else
|
||||
ChangeStatus(SCE_UTILITY_STATUS_NONE, delayUs);
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "Core/HLE/sceKernel.h"
|
||||
#include "Core/HLE/sceKernelMemory.h"
|
||||
#include "Core/HLE/sceKernelThread.h"
|
||||
#include "Core/HLE/scePower.h"
|
||||
#include "Core/HLE/sceUtility.h"
|
||||
|
||||
#include "Core/Dialog/PSPSaveDialog.h"
|
||||
@@ -358,6 +359,11 @@ static int sceUtilitySavedataInitStart(u32 paramAddr) {
|
||||
if (currentDialogActive && currentDialogType != UtilityDialogType::SAVEDATA) {
|
||||
if (PSP_CoreParameter().compat.flags().YugiohSaveFix) {
|
||||
WARN_LOG(SCEUTILITY, "Yugioh Savedata Correction");
|
||||
if (accessThread) {
|
||||
accessThread->Terminate();
|
||||
// Try to unlock in case other dialog was shutting down.
|
||||
KernelVolatileMemUnlock(0);
|
||||
}
|
||||
} else {
|
||||
return hleLogWarning(SCEUTILITY, SCE_ERROR_UTILITY_WRONG_TYPE, "wrong dialog type");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user