libretro/stella2014-libretro

Crash when saving states

Closed this issue · 2 comments

I've got a report stating that Dark Chambers and Dragonstomper are causing the core to crash while saving the game state on both RALibretro and RetroArch: meleu/RALibretro-old#27

I've had similar issues with Elevator Action.

Saw a crash creating a save state for Desert Falcon in RALibretro. Tracked it to this code: https://github.com/libretro/stella-libretro/blob/b0d525b724fa0a9a313e2ea33a590aba98deaabf/libretro.cxx#L131-L144

STATE_SIZE is hard-coded to 512, but for Desert Falcon it wrote 614 bytes, exceeding the allocated buffer size. Verified Dark Chambers and Elevator Action also write 614 bytes. Dragonstomper wrote 34119 bytes!