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

[SDL2] Fixes for WAV playing <targeted to wrong branch, please delete this> #546

Closed
wants to merge 48 commits into from

Conversation

Wohlstand
Copy link
Contributor

There are two bugs got been fixed:

  • Added the skipping of pad byte to fix the work of several WAV files like this one:
    Cymatics_-_BELL_Dusty_C.wav.zip that contains bext chunk with 603 length, but actual size of the chunk os 604 because of a pad byte.
  • Fixed the memory out-of-range access at fetch_float64be() and fetch_float64le() calls.

madebr and others added 30 commits January 6, 2023 16:36
…sound and have the loudness same as other MIDI backends
Ensure that when playing a track it starts from the beginning.
Xcode 14.3 does not allow targeting 10.9, the minimum recommended version is 10.13 and the minimum possible version is 10.11.

(cherry picked from commit ded4f11dc4741de555fdfd760de4bbb9ac1f98ab)
Patch by Alice Rowan (@AliceLR): nothings/stb#1487

Fix residue classdata bounding for f->temp_memory_required.

Updates `start_decoder`'s calculation of `f->temp_memory_required`
to more accurately reflect the required size of the `part_classdata`
array in `decode_residue`.

In `decode_residue`, the value `actual_size` is derived from the
variable `n`, which is sourced from the variable `n2` in
`vorbis_decode_packet_rest`. `n2` is equal to one of the blocksizes
divided by 2 (of which `f->blocksize_1` will always be the greater
value). For residue type 2, `decode_residue` multiplies its copy of
`n` by 2 (back to the original blocksize).

The faulty bounding in `start_decoder` unconditionally divides
`f->blocksize_1` by 2, even for residue type 2. This patch corrects
the bounding to use the full `f->blocksize_1` for residue type 2.

This bug *may* have implications for anything using the alloc
buffer feature, but I don't have an input that would cause this
(the setup requires a much larger temp buffer than `decode_residue`).
I found this bug via a heap corruption crash while fuzzing libxmp,
which uses a work buffer derived from `f->temp_memory_required`
instead of `alloca`. The `alloca` doesn't use `f->temp_memory_required`,
so it does NOT have this bug.
Patch by Alice Rowan (@AliceLR): nothings/stb#1490

Fix broken clamp in codebook_decode_deinterleave_repeat.

The clamp on the effective number of dimensions to decode in
`codebook_decode_deinterleave_repeat` is trivially broken.
libFuzzer managed to find some inputs that exploit this to increase
the number of dimensions to be read past the end of the multiplicands
array.
sezero and others added 18 commits July 5, 2023 17:55
because the full library is under MIT license now.
This avoids the need for settings CACHE variables, and will now show warnings messages.
.. with prowizard format loaders and depackers functionality disabled.
Taken from SDL_wave.c. Fixes playing of some WAV files that contains chunks with non-even length.

WohlSoft/SDL-Mixer-X@073af71
@Wohlstand
Copy link
Contributor Author

OUCH, WRONG TARGET

@Wohlstand Wohlstand closed this Aug 27, 2023
@Wohlstand Wohlstand changed the title [SDL2] Fixes for WAV playing [SDL2] Fixes for WAV playing <targeted to wrong branch, please delete this> Aug 27, 2023
@madebr
Copy link
Contributor

madebr commented Aug 27, 2023

Fyi, it's possible to change the target branch at any time.

@Wohlstand
Copy link
Contributor Author

Fyi, it's possible to change the target branch at any time.

I didn't found anything that could allow me that...

@madebr
Copy link
Contributor

madebr commented Aug 27, 2023

@Wohlstand Wohlstand deleted the wav-fixes-sdl2 branch August 30, 2023 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.