mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 14:32:35 +01:00
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:
parent
db10699c76
commit
aab23c43bc
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user