diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-09-06 22:46:27 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-09-06 22:46:27 +0200 |
| commit | 9d8c77850d67fdf6432982a34d9ffcb59ffc992e (patch) | |
| tree | eb70d82d3fdb90c10e79476bfda4428c85bf8e5f | |
| parent | b4c886d8cf60214bd99aa0a76a8f89277e5c11fe (diff) | |
Report failures to read resources from MXF files.v1.8.81
| -rw-r--r-- | src/smpte_subtitle_asset.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc index 98383532..b9d7e9a3 100644 --- a/src/smpte_subtitle_asset.cc +++ b/src/smpte_subtitle_asset.cc @@ -233,8 +233,18 @@ SMPTESubtitleAsset::read_mxf_resources (shared_ptr<ASDCP::TimedText::MXFReader> ++i) { ASDCP::TimedText::FrameBuffer buffer; - reader->ReadAncillaryResource (i->ResourceID, buffer, dec->context(), dec->hmac()); buffer.Capacity(32 * 1024 * 1024); + auto const result = reader->ReadAncillaryResource(i->ResourceID, buffer, dec->context(), dec->hmac()); + if (ASDCP_FAILURE(result)) { + switch (i->Type) { + case ASDCP::TimedText::MT_OPENTYPE: + throw ReadError(String::compose("Could not read font from MXF file (%1)", static_cast<int>(result))); + case ASDCP::TimedText::MT_PNG: + throw ReadError(String::compose("Could not read subtitle image from MXF file (%1)", static_cast<int>(result))); + default: + throw ReadError(String::compose("Could not read resource from MXF file (%1)", static_cast<int>(result))); + } + } char id[64]; Kumu::bin2UUIDhex (i->ResourceID, ASDCP::UUIDlen, id, sizeof(id)); @@ -603,4 +613,3 @@ SMPTESubtitleAsset::schema_namespace() const DCP_ASSERT(false); } - |
