diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-04-19 22:51:45 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-04-19 22:51:45 +0100 |
| commit | cd810b7658b0f4910c093ac191c2b4ba06ba0677 (patch) | |
| tree | 2fcc3d563a5209570d65838ba310334e59d5d783 /src | |
| parent | 286d8f36d37718a17f7c343301e17d11510a6d15 (diff) | |
Fix crash on make-dcp after trimming end of text subtitles (#1275).
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/player.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 212bcfe45..6fcf57949 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -876,6 +876,10 @@ Player::text_subtitle_start (weak_ptr<Piece> wp, ContentTextSubtitle subtitle) PlayerSubtitles ps; DCPTime const from (content_time_to_dcp (piece, subtitle.from())); + if (from > piece->content->end()) { + return; + } + BOOST_FOREACH (dcp::SubtitleString s, subtitle.subs) { s.set_h_position (s.h_position() + piece->content->subtitle->x_offset ()); s.set_v_position (s.v_position() + piece->content->subtitle->y_offset ()); @@ -918,6 +922,10 @@ Player::subtitle_stop (weak_ptr<Piece> wp, ContentTime to) DCPTime const dcp_to = content_time_to_dcp (piece, to); + if (dcp_to > piece->content->end()) { + return; + } + pair<PlayerSubtitles, DCPTime> from = _active_subtitles.add_to (wp, dcp_to); if (piece->content->subtitle->use() && !_always_burn_subtitles && !piece->content->subtitle->burn()) { |
