Fixed reading of vertical alignment in pac files with 15 bytes header (instead of 12) - thx Ingo :)

This commit is contained in:
Nikolaj Olsson 2016-05-10 20:18:42 +02:00
parent c6e416c442
commit cd835aae49

View File

@ -1096,7 +1096,6 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
int feIndex = index;
const int endDelimiter = 0x00;
byte alignment = buffer[feIndex + 1];
byte verticalAlignment = buffer[feIndex - 1];
var p = new Paragraph();
int timeStartIndex = feIndex - 15;
@ -1120,6 +1119,8 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
return null; // probably not correct index
int maxIndex = timeStartIndex + 10 + textLength;
byte verticalAlignment = buffer[timeStartIndex + 11];
if (_codePage == -1)
GetCodePage(buffer, index, endDelimiter);