This repository has been archived by the owner on Apr 5, 2024. It is now read-only.
Fix usage of pack_fseek in dumb_packfile_skip #94
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to the Allegro 4 docs, the second argument to pack_fseek denotes a relative offset, but dumb assumes it is an absolute offset. This resulted in a bug where music files would not load: for example, in
it_xm_load_sigdata
the call todumbfile_skip
would mess up the file handle and result in the subsequent version check seeing garbage data.There is another faulty usage of
pack_fseek
in this file fromdumb_packfile_seek
, however I don't see a way to resolve it as there is no way to jump to an arbitrary position in an allegro packfile. Besides, it seems unused, so probably best to delete it.