]> git.sesse.net Git - vlc/blobdiff - modules/codec/subsdec.c
Subtitles: avoid infinite loop
[vlc] / modules / codec / subsdec.c
index a69bcf0eb032f6640b2ec6bdaa27afc52f462b4c..1a6d74d6536dc57341ad114581631873411d1684 100644 (file)
@@ -695,12 +695,17 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle )
                             if( psz_subtitle[i_len] == '\"' )
                                 i_len++;
                         }
+                        /* Not a tag, something else we do not understand */
+                        if( i_len == 0 )
+                            *psz_subtitle++;
+
                         psz_subtitle += i_len;
                     }
                     while (*psz_subtitle == ' ')
                         *psz_html++ = *psz_subtitle++;
                 }
-                *psz_html++ = *psz_subtitle++;
+                *psz_html++ = '>';
+                *psz_subtitle++;
             }
             else if( !strncmp( psz_subtitle, "</", 2 ))
             {