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>
Fri, 28 Jan 2022 19:37:02 +0000 (20:37 +0100)
src/lib/dcp_examiner.cc

index 77a1e7c0bdc9c650a8923c49ca5504ed3ade5a6f..f2ec68bddd8786a9a73f6258dc8d757c8600b50b 100644 (file)
@@ -263,6 +263,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);
@@ -282,6 +283,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);
@@ -294,6 +296,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 ();
                        }
@@ -303,6 +306,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);