From: Carl Hetherington Date: Thu, 11 May 2023 11:48:58 +0000 (+0200) Subject: add_fonts_from_examiner() can be called multiple times with the same font X-Git-Tag: v2.16.56~17 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=ff02c27b53222592e394d7cde1c904b27a211488 add_fonts_from_examiner() can be called multiple times with the same font in the case of closed captions with multiple tracks. Don't reuse the same font objects in this case, otherwise we will start with something like font, disambiguate it to 0_font, then disambiguate _that_ to 0_0_font. --- diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index cad775b24..7d835e618 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -831,8 +831,9 @@ add_fonts_from_examiner(shared_ptr text, vectorset_id(id_for_font_in_reel(font->id(), reel_number)); - text->add_font(font); + auto font_copy = make_shared(*font); + font_copy->set_id(id_for_font_in_reel(font->id(), reel_number)); + text->add_font(font_copy); } ++reel_number; }