From a9acc9c9712f06249b46bf8d5455032dbc5ed825 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 8 Sep 2016 19:24:15 +0200 Subject: [PATCH] decoder/Thread: catch C++ exceptions from the decoder plugin --- src/decoder/DecoderThread.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/decoder/DecoderThread.cxx b/src/decoder/DecoderThread.cxx index 694c95e66..e55b2ab69 100644 --- a/src/decoder/DecoderThread.cxx +++ b/src/decoder/DecoderThread.cxx @@ -439,7 +439,7 @@ decoder_run_song(DecoderControl &dc, */ static void decoder_run(DecoderControl &dc) -{ +try { dc.ClearError(); assert(dc.song != nullptr); @@ -463,7 +463,10 @@ decoder_run(DecoderControl &dc) } decoder_run_song(dc, song, uri_utf8, path_fs); - +} catch (...) { + dc.state = DecoderState::ERROR; + dc.error = std::current_exception(); + dc.client_cond.signal(); } static void