diff --git a/src/MpvNet/Player.cs b/src/MpvNet/Player.cs index 25310545..850367a7 100644 --- a/src/MpvNet/Player.cs +++ b/src/MpvNet/Player.cs @@ -407,10 +407,11 @@ void ProcessBluRayLogMessage(string msg) if (msg.Contains(" duration: ")) { int start = msg.IndexOf(" duration: ") + 11; - BluRayTitles.Add(new TimeSpan( - msg.Substring(start, 2).ToInt(), - msg.Substring(start + 3, 2).ToInt(), - msg.Substring(start + 6, 2).ToInt())); + if (msg.Length >= start + 8) + BluRayTitles.Add(new TimeSpan( + msg.Substring(start, 2).ToInt(), + msg.Substring(start + 3, 2).ToInt(), + msg.Substring(start + 6, 2).ToInt())); } } }