From e7d0ce72dd548a8494cd0074084127e5dfb453d8 Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 2 Mar 2020 20:52:03 -0500 Subject: [PATCH] view: catch exception on Visual constructor #378 --- src/view/view.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/view/view.cpp b/src/view/view.cpp index 197b29e83..a759fddbf 100644 --- a/src/view/view.cpp +++ b/src/view/view.cpp @@ -173,7 +173,14 @@ int main(int argc, char** argv){ std::array errbuf; int frames = 0; int averr; - auto ncv = std::make_unique(argv[i], &averr, 1, 0, stretchmode); + std::unique_ptr ncv; + try{ + ncv = std::make_unique(argv[i], &averr, 1, 0, stretchmode); + }catch(std::exception& e){ + nc.stop(); + std::cerr << argv[i] << ": " << e.what() << "\n"; + return EXIT_FAILURE; + } if(!ncv){ av_make_error_string(errbuf.data(), errbuf.size(), averr); nc.stop();