diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-06-28 13:04:30 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-06-28 13:04:30 +0200 |
| commit | d70f72ad7b25f5b71e8c27381e8bfdce6c0fa5b4 (patch) | |
| tree | 820d05ace03e08e140f7f31e84a893b5db04e15c | |
| parent | 8b45384a7c9162d30309345ae863b4cab86aeda1 (diff) | |
| parent | 3dbe0b9ff88a16b938ad6adf2c26179e278fa712 (diff) | |
Merge remote-tracking branch 'origin/main' into v2.17.x
| -rw-r--r-- | cscript | 2 | ||||
| -rw-r--r-- | src/lib/font_id_allocator.cc | 4 | ||||
| m--------- | test/data | 0 | ||||
| -rw-r--r-- | test/subtitle_font_id_test.cc | 15 |
4 files changed, 19 insertions, 2 deletions
@@ -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 + }); +} + |
