Fixed: rare crashes at scene changes with sound-effect mods on (#90)
Reported in issue #90: once in a while the game closed when entering a battle, leaving the menu, or moving between areas, more often with many mods on and little free memory. The crash records all showed the same thing: some other part of the app had a pointer whose lower half had been overwritten with zeros earlier on.
We tracked it down with a special memory-checking build on our test device, which caught it within a minute. The cause was in FFNx's sound-effect code, which is active whenever a mod replaces the game's sound effects (Echo-S, the Tsunamods set and others). It keeps one record per sound channel. Some calls used the wrong channel number, and every battle transition touched a channel that had no record. Each time, the game wrote a few bytes just past the end of that table, usually zeros, into memory that belonged to something else. Most of the time nothing happened; sometimes it hit a pointer, and whatever used that pointer next crashed.
Every sound channel now has its own record, and the channel numbers are checked. On the test device, menus, battle transitions, battles and escapes ran with no stray writes.
Updating
Go to Settings → Updates in the launcher (or install this APK over your current version), then press Play. It asks to Update the game once (a few seconds).
APK SHA-256: d1604849eb0ccc8a6e925ae5942e86cccb0d9b3cef429e8fe6b3f1cb765e7702
Signing certificate SHA-256: 4f:c0:18:09:12:1b:af:25:f5:8c:8f:5e:7a:47:c4:80:c4:f8:6c:1e:a0:66:6e:37:c7:41:19:13:40:4d:1d:7c