From d8136adbed1653561d2107174e628e2eaa386ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 2 Jan 2023 22:01:20 +0100 Subject: [PATCH] GPUCommon::FastRunLoop: Try not to crash --- GPU/GPUCommon.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 5e5ea82763..a1c205cfdc 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -1197,6 +1197,13 @@ bool GPUCommon::InterpretList(DisplayList &list) { // Maybe should write this in ASM... void GPUCommon::FastRunLoop(DisplayList &list) { PROFILE_THIS_SCOPE("gpuloop"); + + if (!Memory::IsValidAddress(list.pc)) { + // We're having some serious problems here, just bail and try to limp along and not crash the app. + downcount = 0; + return; + } + const CommandInfo *cmdInfo = cmdInfo_; int dc = downcount; for (; dc > 0; --dc) {