Commit 0560ceb3 authored by Rafaël Carré's avatar Rafaël Carré

subsdec: avoid segfaults

parent 0740e543
...@@ -735,7 +735,7 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle ) ...@@ -735,7 +735,7 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle )
{ {
bool b_match = false; bool b_match = false;
bool b_ignore = false; bool b_ignore = false;
int i_len = strlen( psz_tag ) - 1; int i_len = (psz_tag ? strlen(psz_tag) : 0) - 1;
char *psz_lastTag = NULL; char *psz_lastTag = NULL;
if( i_len >= 0 ) if( i_len >= 0 )
...@@ -954,7 +954,7 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle ) ...@@ -954,7 +954,7 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle )
} }
} }
while( *psz_tag ) while( psz_tag && *psz_tag )
{ {
/* */ /* */
char *psz_last = &psz_tag[strlen(psz_tag)-1]; char *psz_last = &psz_tag[strlen(psz_tag)-1];
......
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