BRRtools
BRRtools copied to clipboard
Fix undefined behavior causing WAV files to be unrecognized
gcc (GCC) 11.2.0 produced a binary which treated even valid .wav files as Input file in unsupported format : "WAVEfmt" block missing !. This change fixes that.
This is the minimum work necessary to make the project build and run; it seems to work in practice. There's still some compiler warnings left, and maybe UB-type bugs in the code as well (I didn't test valgrind/asan yet). Also, IIRC the BRR decoder is incorrect and causes the encoder to generate incorrect BRR files in some edge cases, which decode properly in brr_decoder but not in accurate emulators (in rare circumstances, eg. when Gaussian filtering or resampling produces internal values beyond ±32k), probably related to #13.
Cool. What does the "sc" in wave_sc1 stand for?