diff options
Diffstat (limited to 'src/verify.cc')
| -rw-r--r-- | src/verify.cc | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/src/verify.cc b/src/verify.cc index 822037ca..0de5a744 100644 --- a/src/verify.cc +++ b/src/verify.cc @@ -443,25 +443,35 @@ verify_picture_asset (shared_ptr<const ReelFileAsset> reel_file_asset, boost::fi if (auto mono_asset = dynamic_pointer_cast<MonoPictureAsset>(reel_file_asset->asset_ref().asset())) { auto reader = mono_asset->start_read (); for (int64_t i = 0; i < duration; ++i) { - auto frame = reader->get_frame (i); - biggest_frame = max(biggest_frame, frame->size()); - if (!mono_asset->encrypted() || mono_asset->key()) { - vector<VerificationNote> j2k_notes; - verify_j2k (frame, j2k_notes); - check_and_add (j2k_notes); + try { + auto frame = reader->get_frame (i); + biggest_frame = max(biggest_frame, frame->size()); + if (!mono_asset->encrypted() || mono_asset->key()) { + vector<VerificationNote> j2k_notes; + verify_j2k (frame, j2k_notes); + check_and_add (j2k_notes); + } + } + catch (ReadError const& e) { + notes.push_back({VerificationNote::Type::ERROR, VerificationNote::Code::INVALID_MXF_CODESTREAM, string(e.what()) }); } progress (float(i) / duration); } } else if (auto stereo_asset = dynamic_pointer_cast<StereoPictureAsset>(asset)) { auto reader = stereo_asset->start_read (); for (int64_t i = 0; i < duration; ++i) { - auto frame = reader->get_frame (i); - biggest_frame = max(biggest_frame, max(frame->left()->size(), frame->right()->size())); - if (!stereo_asset->encrypted() || stereo_asset->key()) { - vector<VerificationNote> j2k_notes; - verify_j2k (frame->left(), j2k_notes); - verify_j2k (frame->right(), j2k_notes); - check_and_add (j2k_notes); + try { + auto frame = reader->get_frame (i); + biggest_frame = max(biggest_frame, max(frame->left()->size(), frame->right()->size())); + if (!stereo_asset->encrypted() || stereo_asset->key()) { + vector<VerificationNote> j2k_notes; + verify_j2k (frame->left(), j2k_notes); + verify_j2k (frame->right(), j2k_notes); + check_and_add (j2k_notes); + } + } + catch (ReadError const& e) { + notes.push_back({VerificationNote::Type::ERROR, VerificationNote::Code::INVALID_MXF_CODESTREAM, string(e.what()) }); } progress (float(i) / duration); } @@ -1925,6 +1935,8 @@ dcp::note_to_string (VerificationNote note) return "Some assets are encrypted but some are not."; case VerificationNote::Code::INVALID_JPEG2000_CODESTREAM: return String::compose("The JPEG2000 codestream for at least one frame is invalid (%1).", note.note().get()); + case VerificationNote::Code::INVALID_MXF_CODESTREAM: + return String::compose("The MXF codestream for at least one frame is invalid (%1).", note.note().get()); case VerificationNote::Code::INVALID_JPEG2000_GUARD_BITS_FOR_2K: return String::compose("The JPEG2000 codestream uses %1 guard bits in a 2K image instead of 1.", note.note().get()); case VerificationNote::Code::INVALID_JPEG2000_GUARD_BITS_FOR_4K: |
