summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2021-03-05 19:11:57 +0100
committerMax Kellermann <max@musicpd.org>2021-03-05 19:12:22 +0100
commit17f7098e2754d916da6ee1e48909af8ab2f3e574 (patch)
tree3254f39ad464f9dbc78803ce6628a22fa84a09f4
parent9ff790b7bb794b0828e034f14ae532680f349d0c (diff)
output/wasapi: SafeTry() catches all exceptions
Fixes crash due to std::stoul() throwing std::invalid_argument.
-rw-r--r--src/output/plugins/wasapi/WasapiOutputPlugin.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx
index 58a12918d..13ddb3f1e 100644
--- a/src/output/plugins/wasapi/WasapiOutputPlugin.cxx
+++ b/src/output/plugins/wasapi/WasapiOutputPlugin.cxx
@@ -90,8 +90,8 @@ inline bool SafeTry(Functor &&functor) {
try {
functor();
return true;
- } catch (std::runtime_error &err) {
- FormatError(wasapi_output_domain, "%s", err.what());
+ } catch (...) {
+ FormatError(std::current_exception(), "%s");
return false;
}
}
@@ -101,7 +101,7 @@ inline bool SafeSilenceTry(Functor &&functor) {
try {
functor();
return true;
- } catch (std::runtime_error &err) {
+ } catch (...) {
return false;
}
}