dbry / WavPack

WavPack encode/decode library, command-line programs, and several plugins
BSD 3-Clause "New" or "Revised" License
371 stars 67 forks source link

UBSan: left shift of negative value -1 #81

Closed andreafioraldi closed 4 years ago

andreafioraldi commented 4 years ago

Running wavpack compiled with UBSan I get the following error: wavpack.c:3781:70: runtime error: left shift of negative value -1

This is ofc undefined behavior due to the fact that you are shifting possible negative values in this line (and the following), https://github.com/dbry/WavPack/blob/master/cli/wavpack.c#L3781

dbry commented 4 years ago

Thanks for reporting! Yes, I am very aware of the undefined behavior issues and and have been addressing those in libwavpack first, with the help of oss-fuzz. I will get to the ones in the command-line programs some time in the future.

dbry commented 4 years ago

I believe this is now fixed in master. Thanks again!