BRRtools icon indicating copy to clipboard operation
BRRtools copied to clipboard

Fix undefined behavior causing WAV files to be unrecognized

Open nyanpasu64 opened this issue 3 years ago • 1 comments

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.

nyanpasu64 avatar May 13 '22 09:05 nyanpasu64

Cool. What does the "sc" in wave_sc1 stand for?

jeffythedragonslayer avatar Jun 02 '23 20:06 jeffythedragonslayer