mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Fixed possible crash when saving ebu + now saves language code - thx Richard :)
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@733 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
0d741203ca
commit
df1f23c0bb
@ -159,6 +159,9 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
_header.DiskFormatCode = "STL25.01";
|
_header.DiskFormatCode = "STL25.01";
|
||||||
|
|
||||||
_header.CharacterCodeTableNumber = "0" + comboBoxCharacterCodeTable.SelectedIndex.ToString();
|
_header.CharacterCodeTableNumber = "0" + comboBoxCharacterCodeTable.SelectedIndex.ToString();
|
||||||
|
_header.LanguageCode = textBoxLanguageCode.Text;
|
||||||
|
if (_header.LanguageCode.Length != 2)
|
||||||
|
_header.LanguageCode = "0A";
|
||||||
_header.OriginalProgrammeTitle = textBoxOriginalProgramTitle.Text.PadRight(32, ' ');
|
_header.OriginalProgrammeTitle = textBoxOriginalProgramTitle.Text.PadRight(32, ' ');
|
||||||
_header.OriginalEpisodeTitle = textBoxOriginalEpisodeTitle.Text.PadRight(32, ' ');
|
_header.OriginalEpisodeTitle = textBoxOriginalEpisodeTitle.Text.PadRight(32, ' ');
|
||||||
_header.TranslatedProgrammeTitle = textBoxTranslatedProgramTitle.Text.PadRight(32, ' ');
|
_header.TranslatedProgrammeTitle = textBoxTranslatedProgramTitle.Text.PadRight(32, ' ');
|
||||||
|
@ -411,6 +411,9 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
|
|
||||||
public void Save(string fileName, Subtitle subtitle)
|
public void Save(string fileName, Subtitle subtitle)
|
||||||
{
|
{
|
||||||
|
if (fileName.Length > 32)
|
||||||
|
fileName = fileName.Substring(0, 32).Trim();
|
||||||
|
|
||||||
EbuGeneralSubtitleInformation header = new EbuGeneralSubtitleInformation();
|
EbuGeneralSubtitleInformation header = new EbuGeneralSubtitleInformation();
|
||||||
EbuSaveOptions saveOptions = new EbuSaveOptions();
|
EbuSaveOptions saveOptions = new EbuSaveOptions();
|
||||||
if (subtitle.Header != null && subtitle.Header.Length > 1024 && (subtitle.Header.Contains("STL25") || subtitle.Header.Contains("STL30")))
|
if (subtitle.Header != null && subtitle.Header.Length > 1024 && (subtitle.Header.Contains("STL25") || subtitle.Header.Contains("STL30")))
|
||||||
|
Loading…
Reference in New Issue
Block a user