diff options
author | gameblabla | 2019-07-21 07:43:56 +0200 |
---|---|---|
committer | gameblabla | 2019-07-21 07:43:56 +0200 |
commit | 0f598f20d1c618933ffd1a02207912915fcd454e (patch) | |
tree | 44d78d879b2ca053beb10228a22675429b6fa131 /libpcsxcore | |
parent | bf643fd9c59939266ee95021292a08b5d20a250e (diff) | |
download | pcsx_rearmed-0f598f20d1c618933ffd1a02207912915fcd454e.tar.gz pcsx_rearmed-0f598f20d1c618933ffd1a02207912915fcd454e.tar.bz2 pcsx_rearmed-0f598f20d1c618933ffd1a02207912915fcd454e.zip |
psxbios: Add checks for memchr.
Diffstat (limited to 'libpcsxcore')
-rw-r--r-- | libpcsxcore/psxbios.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index 7b2c05f..3247402 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -924,6 +924,12 @@ void psxBios_memcmp() { // 0x2d void psxBios_memchr() { // 0x2e char *p = (char *)Ra0; + + if (a0 == 0 || a2 > 0x7FFFFFFF) + { + pc0 = ra; + return; + } while ((s32)a2-- > 0) { if (*p++ != (s8)a1) continue; |