Fixed crash when loading sub from dvd - thx Cristiano :)

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@2022 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2013-08-23 21:28:42 +00:00
parent e02f74965c
commit 04b7379850
2 changed files with 27 additions and 4 deletions

View File

@ -288,6 +288,7 @@ E-mail: mailto:nikse.dk@gmail.com</AboutText1>
<GeneralSubtitleInformation>General subtitle information</GeneralSubtitleInformation>
<CodePageNumber>Code page number</CodePageNumber>
<DiskFormatCode>Disk format code</DiskFormatCode>
<DisplayStandardCode>Display standard code</DisplayStandardCode>
<CharacterCodeTable>Character table</CharacterCodeTable>
<LanguageCode>Language code</LanguageCode>
<OriginalProgramTitle>Original program title</OriginalProgramTitle>
@ -324,6 +325,18 @@ E-mail: mailto:nikse.dk@gmail.com</AboutText1>
<TotalMilliseconds>Total millisecs.:</TotalMilliseconds>
<EndDelayInMillisecs>Slut forsinkelse i millisek.:</EndDelayInMillisecs>
</EffectTypewriter>
<ExportCustomText>
<Title>Eksporter bruger-defineret tekstformat</Title>
<Formats>Formater</Formats>
<SaveAs>Gem som...</SaveAs>
</ExportCustomText>
<ExportCustomTextFormat>
<Title>Brugerdefineret tekstformat skabelon</Title>
<Template>Skabelon</Template>
<Header>Header</Header>
<TextLine>Tekstlinje (afsnit)</TextLine>
<Footer>Footer</Footer>
</ExportCustomTextFormat>
<ExportPngXml>
<Title>Eksporter BDN XML/PNG</Title>
<ImageSettings>Billedindstillinger</ImageSettings>
@ -651,6 +664,7 @@ E-mail: mailto:nikse.dk@gmail.com</AboutText1>
<ExportCaptionsInc>Captions Inc...</ExportCaptionsInc>
<ExportCheetahCap>Cheetah CAP...</ExportCheetahCap>
<ExportUltech130>Ultech caption...</ExportUltech130>
<ExportCustomTextFormat>Eksporter bruger-defineret tekstformat...</ExportCustomTextFormat>
<Exit>&amp;Afslut</Exit>
</File>
<Edit>
@ -697,6 +711,8 @@ E-mail: mailto:nikse.dk@gmail.com</AboutText1>
<TextNumberOfCharactersPerSeconds>Tekst - antallet af tegn/sek</TextNumberOfCharactersPerSeconds>
<WordsPerMinute>Tekst - ord i minuttet (WPM)</WordsPerMinute>
<Style>Style</Style>
<Ascending>Stigende</Ascending>
<Descending>Faldende</Descending>
<MakeNewEmptyTranslationFromCurrentSubtitle>Dan ny tom oversættelse fra aktuelle undertekst</MakeNewEmptyTranslationFromCurrentSubtitle>
<BatchConvert>Batch konverter...</BatchConvert>
<GenerateTimeAsText>Generer tid som tekst...</GenerateTimeAsText>

View File

@ -162,12 +162,19 @@ namespace Nikse.SubtitleEdit.Logic.VobSub
case (int)DisplayControlCommand.ChangeColorAndContrast: // 7
commandIndex++;
//int parameterAreaSize = (int)Helper.GetEndian(_data, commandIndex, 2);
int parameterAreaSize = _data[commandIndex + 1]; // this should be enough??? (no larger than 255 bytes)
if (colorLookUpTable != null)
if (commandIndex + 1 < _data.Length)
{
//TODO: set fourColors
int parameterAreaSize = _data[commandIndex + 1]; // this should be enough??? (no larger than 255 bytes)
if (colorLookUpTable != null)
{
//TODO: set fourColors
}
commandIndex += parameterAreaSize;
}
else
{
commandIndex++;
}
commandIndex += parameterAreaSize;
break;
case (int)DisplayControlCommand.End: // FF (255) - Stop looping of Display Control Commands
break;