Bail out early when there's a reason why the KDM is invalid.
authorCarl Hetherington <cth@carlh.net>
Fri, 28 Jan 2022 19:37:02 +0000 (20:37 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 9 Mar 2022 16:04:02 +0000 (17:04 +0100)
src/lib/dcp_examiner.cc

index f61e2a7de1f0dad23073339ee1f07c08505136da..04711130b9e2357412ce1624e924f2e444ebdd13 100644 (file)
@@ -257,6 +257,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
                        if (pic->encrypted() && !pic->key()) {
                                _kdm_valid = false;
                                LOG_GENERAL_NC ("Picture has no key");
+                               break;
                        }
                        auto mono = dynamic_pointer_cast<dcp::MonoPictureAsset>(pic);
                        auto stereo = dynamic_pointer_cast<dcp::StereoPictureAsset>(pic);
@@ -276,6 +277,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
                                if (sound->encrypted() && !sound->key()) {
                                        _kdm_valid = false;
                                        LOG_GENERAL_NC ("Sound has no key");
+                                       break;
                                }
                                auto reader = i->main_sound()->asset()->start_read();
                                reader->set_check_hmac (false);
@@ -288,6 +290,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
                                if (mxf_sub && mxf_sub->encrypted() && !mxf_sub->key()) {
                                        _kdm_valid = false;
                                        LOG_GENERAL_NC ("Subtitle has no key");
+                                       break;
                                }
                                sub->subtitles ();
                        }
@@ -297,6 +300,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
                                if (atmos->encrypted() && !atmos->key()) {
                                        _kdm_valid = false;
                                        LOG_GENERAL_NC ("ATMOS sound has no key");
+                                       break;
                                }
                                auto reader = atmos->start_read();
                                reader->set_check_hmac (false);