Skip to content

Commit

Permalink
Fix header writing
Browse files Browse the repository at this point in the history
Seeking from the start of an empty ofstream can yield undefined behavior, for certain paks it corrupts the stream. Just pad out the header with the new method that was added in f96c711. This fixes ui_sdk.rpak coming out corrupt.
  • Loading branch information
Mauler125 committed Dec 23, 2024
1 parent f96c711 commit 7c77279
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/logic/pakfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ void CPakFileBuilder::BuildFromMap(const string& mapPath)

// write a placeholder header so we can come back and complete it
// when we have all the info
out.Seek(pakVersion >= 8 ? 0x80 : 0x58);
out.Pad(pakVersion >= 8 ? 0x80 : 0x58);

const char* streamFileMandatory = nullptr;

Expand Down

0 comments on commit 7c77279

Please sign in to comment.