NBlood
NBlood copied to clipboard
[Exhumed] Potential OOB with sequence for rat.
In Raze, we've recently just re-written the sequence system to use proper objects to represent a sequence, a sequence's frames, and a frame's chunks. Its a lot better and easier to work with, however so far I've observed a number of OOBs from this, which may or may not be consequential but I wanted to share them anyway.
https://github.com/ZDoom/Raze/commit/fe356f31830495e3f5da64a8affce4b20005d96d repairs an issue where the frame index is XOR'd by 1, resulting in a frame index of 5. The total frames for this sequence is 5, so the net result is the first frame of the next sequence would be played here.
https://github.com/ZDoom/Raze/commit/4428ea5612cad9f36df483ff65785d07230afc33 repairs an issue where for the spider, frames 9 and above do not have any chunks, therefore accessing the chunk array could either return garbage data, or the picnum for another frame or sequence. The fix in this commit is average, it's fixed in the next example.
https://github.com/ZDoom/Raze/commit/1162954b036ea5f986dd4b1d096aa1f831988471 moves the null check into our texture getter to eliminate the potential null accesses, but highlights that I did indeed experience a null access when attempting to get the texture/picnum from a non-existent chunk for the rat, just as I did with the spider.
https://github.com/ZDoom/Raze/commit/ba8bdf347e703cac27d899992688f0bf69988073 resets the nFrame value for the Anubis actor where the action was changing, but the frame number was not resetting along with it, as all other nAction changes are doing.
https://github.com/ZDoom/Raze/commit/408c71513b8ba2169b612b9adfe56fb545877ba6 was a manual comb through the soruce after fixing the Anubis to find other such occurences, at least 20+ were found.