Preserve trailing movie bytes when replacing GFx shapes #4992

Open
github-bot wants to merge 1 commit from github-bot/gh-4991 into main AGit
Owner

@⁠RanoGames on GitHub · 2026-12-01 16:46 UTC · original
RanoGames:fix/gfx-preserve-movie-tail → main · +10 −5 · 1 files · 1 commits · open

What it changes

Movie::replace_shapes rebuilds a GFx movie through its first End tag. When the declared file length includes bytes after that tag, even an empty replacement list loses those bytes. Preserve the suffix verbatim and include it when recalculating the length after a shape changes size.

How it was tested

  • Windows x64, synthetic movie data. A no-op replacement shortened a 40-byte movie to 37 bytes on 5fabb46e.
  • On 7d994c81, the no-op returns the original bytes. Replacing a shape with a larger one preserves the suffix and writes the expected new length.
  • cargo test --locked -p victory-formats passed (85 tests, 7 ignored). The 18 GFx unit tests also passed separately. Game playback was outside the scope of this test.

Checked for overlap

  • Searched issues and PRs for replace_shapes, trailing bytes and the GFx End tag. #2798 also touches the GFx parser for PlayStation prompts. It handles shape recognition.
**@⁠RanoGames** on GitHub · 2026-12-01 16:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4991) `RanoGames:fix/gfx-preserve-movie-tail` → `main` · +10 −5 · 1 files · 1 commits · open ## What it changes `Movie::replace_shapes` rebuilds a GFx movie through its first End tag. When the declared file length includes bytes after that tag, even an empty replacement list loses those bytes. Preserve the suffix verbatim and include it when recalculating the length after a shape changes size. ## How it was tested - Windows x64, synthetic movie data. A no-op replacement shortened a 40-byte movie to 37 bytes on `5fabb46e`. - On `7d994c81`, the no-op returns the original bytes. Replacing a shape with a larger one preserves the suffix and writes the expected new length. - `cargo test --locked -p victory-formats` passed (85 tests, 7 ignored). The 18 GFx unit tests also passed separately. Game playback was outside the scope of this test. ## Checked for overlap - [x] Searched issues and PRs for `replace_shapes`, trailing bytes and the GFx End tag. #2798 also touches the GFx parser for PlayStation prompts. It handles shape recognition.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 16:51:42 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/4992/head:github-bot/gh-4991'
git switch 'github-bot/gh-4991'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4991'
git switch 'github-bot/gh-4991'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4991'
git switch 'github-bot/gh-4991'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4991'
git switch 'main'
git merge --squash 'github-bot/gh-4991'
git switch 'main'
git merge --ff-only 'github-bot/gh-4991'
git switch 'main'
git merge 'github-bot/gh-4991'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!4992
No description provided.