Don't try to create non-existent DCPs when searching for CPLs (DoM #2344).
authorCarl Hetherington <cth@carlh.net>
Mon, 26 Sep 2022 17:43:47 +0000 (19:43 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 26 Sep 2022 17:43:47 +0000 (19:43 +0200)
src/search.cc

index dd02a2e0c96dc28c5fc1acf23fa5405086c5cb70..f45a2fb9c5020a2a923dfcb7c9aa53179505a216 100644 (file)
@@ -59,6 +59,12 @@ dcp::find_and_resolve_cpls (vector<boost::filesystem::path> const& directories,
 
        vector<shared_ptr<dcp::DCP>> dcps;
        for (auto i: directories) {
+               if (!boost::filesystem::exists(i)) {
+                       /* Don't make a DCP object or it will try to create the parent directories
+                        * of i if they do not exist (#2344).
+                        */
+                       continue;
+               }
                auto dcp = make_shared<dcp::DCP>(i);
                vector<dcp::VerificationNote> notes;
                dcp->read (&notes, true);