Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FF7: Fix field chunk size calculation for the chunk number 9 #763

Merged
merged 4 commits into from
Dec 7, 2024

Conversation

zaphod77
Copy link
Contributor

@zaphod77 zaphod77 commented Dec 7, 2024

Summary

So since i don't typically run gameplay mods, i missed a crash i caused by trying to use known_field_buffer_size to calculate the actual size of chunk 11. Even trying to do this causes stuff to be written outside the buffer, which is bad. Since ffnx doesn't have it's own decompressor, i can't get the real size. so I have no choice but to trust the section header.

Motivation

Fixing what I broke.

ACKs

  • I have updated the Changelog.md file
  • I did test my code on FF7

Turns out we can't actually use known_field_buffer_size after all. :(  

This causes crashes.
@julianxhokaxhiu julianxhokaxhiu changed the title Fix what i broke with my previous fix. FF7: Fix chunk size calculation for the chunk number 9 Dec 7, 2024
@julianxhokaxhiu julianxhokaxhiu changed the title FF7: Fix chunk size calculation for the chunk number 9 FF7: Fix field chunk size calculation for the chunk number 9 Dec 7, 2024
@julianxhokaxhiu julianxhokaxhiu merged commit d84e7c4 into julianxhokaxhiu:master Dec 7, 2024
1 check passed
@julianxhokaxhiu julianxhokaxhiu added the bug Something isn't working label Dec 7, 2024
@julianxhokaxhiu julianxhokaxhiu added this to the 1.21.2 milestone Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants