Sometimes the mdec.rl pointer is outside the bounds of the PSX memory block. I haven't figured out why, but this will prevent it from segfaulting when it tries to dereference the `mdec_rl' pointer inside the rl2blk() function. Hopefully this is a low-impact workaround.
Game affected:
Metal Gear Solid
I was just playing and every time at a certain point (after beating the first boss, when the XA video of the nuclear silos was loading) the video loading would cause it to segfault. With this extra check, the video loads but a few frames are messed up, and some vertical lines are running through it, but it doesn't crash.
GDB output:
Program received signal SIGSEGV, Segmentation fault.
rl2blk (blk=0x7fffffff9c90, mdec_rl=0x7fe6101e2000) at ../libpcsxcore/mdec.c:253
253 rl = SWAP16(*mdec_rl); mdec_rl++;
My system:
Linux necronomicon 3.2.21 #2 SMP Sun Jun 24 11:55:51 CDT 2012 x86_64 AMD Phenom(tm) II X3 720 Processor AuthenticAMD GNU/Linux
[configured pcsxr with --enable-opengl]
Comments: ** Comment from web user: MaddTheSane **
Game affected:
Metal Gear Solid
I was just playing and every time at a certain point (after beating the first boss, when the XA video of the nuclear silos was loading) the video loading would cause it to segfault. With this extra check, the video loads but a few frames are messed up, and some vertical lines are running through it, but it doesn't crash.
GDB output:
Program received signal SIGSEGV, Segmentation fault.
rl2blk (blk=0x7fffffff9c90, mdec_rl=0x7fe6101e2000) at ../libpcsxcore/mdec.c:253
253 rl = SWAP16(*mdec_rl); mdec_rl++;
My system:
Linux necronomicon 3.2.21 #2 SMP Sun Jun 24 11:55:51 CDT 2012 x86_64 AMD Phenom(tm) II X3 720 Processor AuthenticAMD GNU/Linux
[configured pcsxr with --enable-opengl]
Comments: ** Comment from web user: MaddTheSane **
A good place to report patches is in the submit patches section, under source code.