kodi-game / game.libretro

Libretro compatibility layer for the Kodi Game API
GNU General Public License v2.0
37 stars 26 forks source link

Fix segfault on several cores #46

Closed garbear closed 6 years ago

garbear commented 6 years ago

The segfaults occur because the core is trying to determine the ROM's base name from the path. However, when loading by memory, the libretro API says the path must be null. When noncompliant cores try to parse the null path, they segfault.

To fix this, we just set the path parameter even when loading by memory.

However, there is a potential problem: the libretro API says if path is set, it must be valid. But VFS paths are invalid, because cores can't load from Kodi's VFS. So this may cause cores to fail for ROMs on network drives.

Motivation:

Continued from https://github.com/libretro/beetle-gba-libretro/pull/33.

How Has This Been Tested?

Test builds: Coming soon.

Tested on OSX with FCEUmm with local files.

Screenshots

FCEUmm no longer crashes:

fceumm