Fix stupid crash in dcpomatic_create when adding a DCP without a KDM.
authorCarl Hetherington <cth@carlh.net>
Tue, 12 Jul 2022 21:03:33 +0000 (23:03 +0200)
committerCarl Hetherington <cth@carlh.net>
Tue, 12 Jul 2022 21:03:33 +0000 (23:03 +0200)
src/tools/dcpomatic_create.cc

index a4f8dda6ac65e36435133a0d327ece208ee86e37..8ce7d90a2c9062a73c44165a3b449667e0feeddd 100644 (file)
@@ -125,7 +125,9 @@ main (int argc, char* argv[])
                        if (boost::filesystem::exists (can / "ASSETMAP") || (boost::filesystem::exists (can / "ASSETMAP.xml"))) {
                                auto dcp = make_shared<DCPContent>(can);
                                film_content_list.push_back (dcp);
-                               dcp->add_kdm (dcp::EncryptedKDM(dcp::file_to_string(*cli_content.kdm)));
+                               if (cli_content.kdm) {
+                                       dcp->add_kdm (dcp::EncryptedKDM(dcp::file_to_string(*cli_content.kdm)));
+                               }
                        } else {
                                /* I guess it's not a DCP */
                                film_content_list = content_factory (can);