Merge remote-tracking branch 'origin/main' into v2.17.x
authorCarl Hetherington <cth@carlh.net>
Fri, 28 Jun 2024 11:04:30 +0000 (13:04 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 28 Jun 2024 11:04:30 +0000 (13:04 +0200)
cscript
src/lib/font_id_allocator.cc
test/data
test/subtitle_font_id_test.cc

diff --git a/cscript b/cscript
index baece29e1b2f458bf12ef1ed61c82052a8403352..c5e2df9e914fc88d34520bca17a0fe5681fcbde6 100644 (file)
--- 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'))
index 76b52e730c15afafd7d5ffee3ce277b4afa81217..d5430e8584907f94856cd7f2033ff3a0052748d7 100644 (file)
@@ -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;
 }
 
index 02050bb9632658f0ce85ace219302b534f81eecc..3a3b29c0f1e9e2654ddee2028be623e1e1b3a33f 160000 (submodule)
--- a/test/data
+++ b/test/data
@@ -1 +1 @@
-Subproject commit 02050bb9632658f0ce85ace219302b534f81eecc
+Subproject commit 3a3b29c0f1e9e2654ddee2028be623e1e1b3a33f
index 49ad4ea05ddf3a5c6550c8e4c609c1f19db64636..8ced35108552d6b716c71a4d536fe0c784df2983 100644 (file)
@@ -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
+               });
+}
+