deltabeard / Peanut-GB

A Game Boy (DMG) emulator single header library written in C99. Performance is prioritised over accuracy.
https://projects.deltabeard.com/peanutgb/
276 stars 35 forks source link

gb: invalid function pointer called on write to 0xFF50 #110

Closed deltabeard closed 1 month ago

deltabeard commented 1 month ago

It has been reported to me in private that it is possible for Peanut-GB to call NULL as a function if a spurious write to 0xFF50 happens. If gb_bootrom_read is not set by the frontend implementation, Peanut-GB could end up calling NULL as a function point when reading the first 0x100 bytes of ROM bank 0.

Thank you to the anonymous reporter.