ddiakopoulos / libnyquist

:microphone: Cross platform C++11 library for decoding audio (mp3, wav, ogg, opus, flac, etc)
BSD 2-Clause "Simplified" License
534 stars 64 forks source link

/arch:AVX causes a crash on some older CPU models #52

Closed Malacath-92 closed 1 year ago

Malacath-92 commented 2 years ago

With this instruction set the MSVC emits unconditional usage of the instructions vpxor and vmovdqu when constructing a std::shared_ptr. On older CPU models that don't support the AVX instruction set this will result in a crash. It was quite frustrating to figure this out given that less than 1% of my users appear to be affected. Maybe this instruction set could not be unconditionally applied to libnyquist when built from CMake? Or maybe the usage of std::shared_ptr can be reduced. Given that all decoders are stateless and 1-byte large there's next to not good reason to use std::shared_ptr for their storage. Although it has been a while since I worked with C++11, maybe something prevents you from avoid that.

Malacath-92 commented 2 years ago

This project had changes since this issue was reported. It's a tiny change that doesn't warrant a PR. Is anyone gonna fix it or are you just gonna leave the responsibility of it on your users?