Skip to content

Commit

Permalink
ssautil: exit early from the styles update loop if we already are at …
Browse files Browse the repository at this point in the history
…the end of the line. Fix an heap overflow.
  • Loading branch information
galad87 committed Jan 24, 2024
1 parent 50a3fc0 commit 11ca508
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libhb/ssautil.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ static int ssa_update_style(const char *ssa, hb_subtitle_style_context_t *ctx)
// Skip any malformed markup junk
while (strchr("\\}", ssa[pos]) == NULL) pos++;
pos++;
// Early exit if there is no tag
if (ssa[pos] == '\0')
{
break;
}
// Check for an index that is in some markup (e.g. font color)
if (isdigit(ssa[pos]))
{
Expand Down

0 comments on commit 11ca508

Please sign in to comment.