Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/subtitles/RTS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2414,6 +2414,7 @@ bool CRenderedTextSubtitle::ParseSSATag( CSubtitle* sub, const AssTagList& assTa
case CMD_fe:
{
int n = wcstol(p, NULL, 10);
if (n < 0) n = DEFAULT_CHARSET;
style.charSet = !p.IsEmpty()
? n
: org.charSet;
Expand Down
5 changes: 4 additions & 1 deletion src/subtitles/STS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,7 @@ static bool OpenSubStationAlpha(CTextFile* file, CSimpleTextSubtitle& ret, int C
{
CString StyleName;
int alpha;
int encoding;
CRect tmp_rect;

StyleName = GetStr(buff);
Expand All @@ -1526,9 +1527,11 @@ if(sver >= 4) style->borderStyle = GetInt(buff);
if(sver >= 6) tmp_rect.bottom = GetInt(buff);
style->marginRect = tmp_rect;
if(sver <= 4) alpha = GetInt(buff);
style->charSet = GetInt(buff);
encoding = GetInt(buff);
if(sver >= 6) style->relativeTo = GetInt(buff);

// Map unsupported extension to the most permissive charSet
style->charSet = encoding < 0 ? DEFAULT_CHARSET : encoding;
if(sver <= 4) style->colors[2] = style->colors[3]; // style->colors[2] is used for drawing the outline
if(sver <= 4) alpha = max(min(alpha, 0xff), 0);
if(sver <= 4) {for(size_t i = 0; i < 3; i++) style->alpha[i] = alpha; style->alpha[3] = 0x80;}
Expand Down