summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-04-08 00:09:00 +0100
committerCarl Hetherington <cth@carlh.net>2019-04-08 00:09:00 +0100
commitb3a4d915b52e524660fd5de02250288fc5be73a0 (patch)
treeadd415851e664634c5384f497f77169f82b2166c
parent52e7e801606015e2fd88e17c9e245d5024463a81 (diff)
Fix crash when adding subtitles.v2.13.145
-rw-r--r--src/wx/closed_captions_dialog.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wx/closed_captions_dialog.cc b/src/wx/closed_captions_dialog.cc
index 8e007c38f..44e6b8da1 100644
--- a/src/wx/closed_captions_dialog.cc
+++ b/src/wx/closed_captions_dialog.cc
@@ -148,10 +148,11 @@ ClosedCaptionsDialog::update (DCPTime time)
_current = optional<TextRingBuffers::Data>();
}
- if (!_current) {
+ if (!_current && !_tracks.empty()) {
/* We have no current one: get another */
shared_ptr<Butler> butler = _butler.lock ();
DCPOMATIC_ASSERT (butler);
+ DCPOMATIC_ASSERT (_track->GetSelection() >= 0);
DCPOMATIC_ASSERT (_track->GetSelection() < int(_tracks.size()));
DCPTextTrack track = _tracks[_track->GetSelection()];
while (true) {