Commit f77a6c48 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

subass: Fix crash in the simple SSA/ASS decoder.

This is the issue exploited by the anime groups.
We now skip anything in { }
Note that ass/ssa cannot have a valid string with text { text } text.
parent cc59dc90
...@@ -93,16 +93,15 @@ void ParseSSAString( decoder_t *p_dec, ...@@ -93,16 +93,15 @@ void ParseSSAString( decoder_t *p_dec,
i_text++; i_text++;
psz_buffer_sub += 2; psz_buffer_sub += 2;
} }
else if( psz_buffer_sub[0] == '{' && else if( psz_buffer_sub[0] == '{' )
psz_buffer_sub[1] == '\\' )
{ {
/* SSA control code */ /* { } Control code in SSA. Cannot be escaped */
while( psz_buffer_sub[0] != '\0' && while( psz_buffer_sub[0] != '\0' &&
psz_buffer_sub[0] != '}' ) psz_buffer_sub[0] != '}' )
{ {
psz_buffer_sub++; psz_buffer_sub++;
} }
psz_buffer_sub++; if( psz_buffer_sub[0] == '}' ) psz_buffer_sub++;
} }
else else
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment