eglaysher / rlvm

RealLive clone for Linux and OSX
http://rlvm.net
GNU General Public License v3.0
150 stars 25 forks source link

Fix Infinite Loop in LBEX Scene 8695 Parsing #100

Closed Mickey-snow closed 3 weeks ago

Mickey-snow commented 1 month ago

At the end of the Little Busters EX combat mini-game, an infinite loop is occurred while parsing seen 8695. The problem occurs in the GosubWithElement constructor where the src pointer doesn't advance when NextData returns zero-length expressions. This behavior was encountered at seen 8695, address 0x886.

Ensuring that the src pointer progresses after each call to NextData regardless of the expression length returned should prevent the infinite loop. While I didn't look into the exact intended behavior of the original bytecode, this workaround seems to solve the problem with no disruptions revealed.