Skip to content

Commit

Permalink
Correct a parser check which broke loading of script embedded UUE fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberbeing committed Apr 26, 2014
1 parent 472cb11 commit 30bcebb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/subtitles/STS.cpp
Expand Up @@ -1398,7 +1398,16 @@ static bool LoadUUEFont(CTextFile* file)
while(file->ReadString(s))
{
s.Trim();
if(s.IsEmpty() || s[0] == '[') break;
if(s.IsEmpty()) break;
if(s[0] == '[') // check for standard section headers
{
if(s.Find(_T("[Script Info]")) == 0) break;
if(s.Find(_T("[V4+ Styles]")) == 0) break;
if(s.Find(_T("[V4 Styles]")) == 0) break;
if(s.Find(_T("[Events]")) == 0) break;
if(s.Find(_T("[Fonts]")) == 0) break;
if(s.Find(_T("[Graphics]")) == 0) break;
}
if(s.Find(_T("fontname:")) == 0) {LoadFont(font); font.Empty(); continue;}

font += s;
Expand Down

0 comments on commit 30bcebb

Please sign in to comment.