summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cscript2
-rw-r--r--src/lib/font_id_allocator.cc4
m---------test/data0
-rw-r--r--test/subtitle_font_id_test.cc15
4 files changed, 19 insertions, 2 deletions
diff --git a/cscript b/cscript
index baece29e1..c5e2df9e9 100644
--- a/cscript
+++ b/cscript
@@ -533,7 +533,7 @@ def make_spec(filename, version, target, options, requires=None):
print('/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :', file=f)
def dependencies(target, options):
- deps = [('libdcp', 'v1.9.9', {'c++17': target.platform == 'osx'})]
+ deps = [('libdcp', 'v1.9.10', {'c++17': target.platform == 'osx'})]
deps.append(('libsub', 'v1.6.49'))
deps.append(('leqm-nrt', '30dcaea1373ac62fba050e02ce5b0c1085797a23'))
deps.append(('rtaudio', 'f619b76'))
diff --git a/src/lib/font_id_allocator.cc b/src/lib/font_id_allocator.cc
index 76b52e730..d5430e858 100644
--- a/src/lib/font_id_allocator.cc
+++ b/src/lib/font_id_allocator.cc
@@ -102,7 +102,9 @@ string
FontIDAllocator::font_id(int reel_index, string asset_id, string font_id) const
{
auto iter = _map.find(Font(reel_index, asset_id, font_id));
- DCPOMATIC_ASSERT(iter != _map.end());
+ if (iter == _map.end()) {
+ return default_font_id();
+ }
return iter->second;
}
diff --git a/test/data b/test/data
-Subproject 02050bb9632658f0ce85ace219302b534f81eec
+Subproject 3a3b29c0f1e9e2654ddee2028be623e1e1b3a33
diff --git a/test/subtitle_font_id_test.cc b/test/subtitle_font_id_test.cc
index 49ad4ea05..8ced35108 100644
--- a/test/subtitle_font_id_test.cc
+++ b/test/subtitle_font_id_test.cc
@@ -332,3 +332,18 @@ BOOST_AUTO_TEST_CASE(subtitle_font_ids_survive_project_save)
check_dcp->check_font_ids();
}
+
+BOOST_AUTO_TEST_CASE(cope_with_unloaded_font_id)
+{
+ /* This file has a <Font> with an ID that corresponds to no <LoadFont> */
+ auto subs = content_factory("test/data/unloaded_font.xml")[0];
+ auto film = new_test_film2("cope_with_unloaded_font_id", { subs });
+
+ make_and_verify_dcp(
+ film,
+ {
+ dcp::VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE,
+ dcp::VerificationNote::Code::MISSING_CPL_METADATA
+ });
+}
+