summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-06-27 20:14:31 +0200
committerCarl Hetherington <cth@carlh.net>2024-06-27 20:14:31 +0200
commitd6e8b54b2b60f70f1a8837183bc184809977be67 (patch)
treefe267959d19bca6480e71701fbd642502319352c /src/lib
parent7e1e6564c680c426b9ec207c82d5ea2b9f4630ea (diff)
Fix error when importing bad subtitle file (#2838).
The subtitle XML refers to a font with no corresponding <LoadFont>.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/font_id_allocator.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/font_id_allocator.cc b/src/lib/font_id_allocator.cc
index 112dd262b..5e4ae9c0f 100644
--- a/src/lib/font_id_allocator.cc
+++ b/src/lib/font_id_allocator.cc
@@ -116,7 +116,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 String::compose("%1_%2", iter->second, font_id);
}