diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-01-08 00:22:55 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-01-08 14:24:44 +0100 |
| commit | fff8fe22db864b967cf2de00d783d4b1bf925a38 (patch) | |
| tree | f92655f49ce22a8ace1163dfe2cf82138c6ebd87 /src | |
| parent | e9a27c5256d1175998ca34603238ac5e53c1f930 (diff) | |
Compare LoadFont URIs and asset paths correctly (DoM #2402).
Diffstat (limited to 'src')
| -rw-r--r-- | src/interop_subtitle_asset.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc index 1e0fe180..b815da55 100644 --- a/src/interop_subtitle_asset.cc +++ b/src/interop_subtitle_asset.cc @@ -241,7 +241,11 @@ InteropSubtitleAsset::resolve_fonts (vector<shared_ptr<Asset>> assets) for (auto load_font_node: _load_font_nodes) { auto iter = std::find_if(_fonts.begin(), _fonts.end(), [load_font_node](Font const& font) { return font.load_id == load_font_node->id; }); - if (iter == _fonts.end() && font->file() && load_font_node->uri == font->file()->leaf().string()) { + + DCP_ASSERT(_file); + auto const path_in_load_font_node = _file->parent_path() / load_font_node->uri; + + if (iter == _fonts.end() && font->file() && path_in_load_font_node == *font->file()) { _fonts.push_back(Font(load_font_node->id, asset->id(), font->file().get())); } } |
