notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Properly protect the HLE instructions against corrupted memory. (#189)
[pcsx_rearmed.git]
/
libpcsxcore
/
psxinterpreter.c
diff --git
a/libpcsxcore/psxinterpreter.c
b/libpcsxcore/psxinterpreter.c
index
cf3de79
..
fa454e1
100644
(file)
--- a/
libpcsxcore/psxinterpreter.c
+++ b/
libpcsxcore/psxinterpreter.c
@@
-842,7
+842,13
@@
void psxBASIC(struct psxCP2Regs *regs) {
void psxHLE() {
// psxHLEt[psxRegs.code & 0xffff]();
void psxHLE() {
// psxHLEt[psxRegs.code & 0xffff]();
- psxHLEt[psxRegs.code & 0x07](); // HDHOSHY experimental patch
+// psxHLEt[psxRegs.code & 0x07](); // HDHOSHY experimental patch
+ uint32_t hleCode = psxRegs.code & 0x03ffffff;
+ if (hleCode >= (sizeof(psxHLEt) / sizeof(psxHLEt[0]))) {
+ psxNULL();
+ } else {
+ psxHLEt[hleCode]();
+ }
}
void (*psxBSC[64])() = {
}
void (*psxBSC[64])() = {