Vobsub: Now skips control sequences with invalid indexes instead of crashing - thx Sofiaguy :)

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1100 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2012-04-08 09:31:06 +00:00
parent db10699c76
commit aab23c43bc

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
namespace Nikse.SubtitleEdit.Logic.VobSub
{
@ -87,6 +88,9 @@ namespace Nikse.SubtitleEdit.Logic.VobSub
{
int delayBeforeExecute = Helper.GetEndianWord(_data, displayControlSequenceTableAddress + _pixelDataAddressOffset);
commandIndex = displayControlSequenceTableAddress + 4 + _pixelDataAddressOffset;
if (commandIndex >= _data.Length)
break; // invalid index
int command = _data[commandIndex];
int numberOfCommands = 0;
while (command != 0xFF && numberOfCommands < 1000 && commandIndex < _data.Length)