ddiakopoulos / libnyquist

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

NyquistIO::Load -> from Buffer - leaves a hole of an open unpropagated exception to the caller #42

Closed phniix closed 4 years ago

phniix commented 4 years ago

Any plausible std::exception raised by decoder->LoadFromBuffer(data, buffer); is not propagated to the caller. This impacts certain load operations not handled by the library.

See here: https://github.com/ddiakopoulos/libnyquist/blob/97d71768ef1fda423368bed87c090afbcfd1df81/src/Common.cpp#L133

A recent change was made in f94005c39885 that rethrew an exception from the file path version of the load. It would be handy if the re-throw also occurred for those users that perform buffer based operations.