diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-07-09 00:23:03 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-07-09 00:23:03 +0200 |
| commit | adc78d62964377960c907cdb538a5bc3a224dafc (patch) | |
| tree | cb0389bd8803c65fb4f0cba364cfe60f9df37c86 /src | |
| parent | 2b32ff2aea16ad128f2e883d8b44f4249ad5da0b (diff) | |
Prevent resolve_fonts from adding duplicate fonts to its list.
Diffstat (limited to 'src')
| -rw-r--r-- | src/interop_subtitle_asset.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc index cfd37cb8..54c27ff5 100644 --- a/src/interop_subtitle_asset.cc +++ b/src/interop_subtitle_asset.cc @@ -202,7 +202,15 @@ InteropSubtitleAsset::resolve_fonts (list<shared_ptr<Asset> > assets) } BOOST_FOREACH (shared_ptr<InteropLoadFontNode> j, _load_font_nodes) { - if (font->file() && j->uri == font->file()->leaf().string ()) { + bool got = false; + BOOST_FOREACH (Font const & k, _fonts) { + if (k.load_id == j->id) { + got = true; + break; + } + } + + if (!got && font->file() && j->uri == font->file()->leaf().string()) { _fonts.push_back (Font (j->id, i->id(), font->file().get())); } } |
