+2018-04-19 Carl Hetherington <cth@carlh.net>
+
+ * Fix crash on making a DCP after trimming the end of some text-based subtitles (#1275).
+
2018-04-13 Carl Hetherington <cth@carlh.net>
* Fix incorrect preview crop with DCP sources when the preview is smaller than half
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 ());
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()) {