[vlc-commits] Subsdec: various fixes for broken subtitles

Jean-Baptiste Kempf git at videolan.org
Wed Oct 10 11:34:03 CEST 2012


vlc/vlc-2.0 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Oct 10 11:27:55 2012 +0200| [8c372e6124e9526286f71571b18baa03550da82b] | committer: Jean-Baptiste Kempf

Subsdec: various fixes for broken subtitles

Close #7553
(cherry picked from commit 26015dacd88f21d48bdebeb499dc8f331baacc19)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=8c372e6124e9526286f71571b18baa03550da82b
---

 modules/codec/subsdec.c |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/modules/codec/subsdec.c b/modules/codec/subsdec.c
index 5b587b1..73d6c64 100644
--- a/modules/codec/subsdec.c
+++ b/modules/codec/subsdec.c
@@ -661,6 +661,10 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle )
                 HtmlCopy( &psz_html, &psz_subtitle, "<font " );
                 strcat( psz_tag, "f" );
 
+                /* <font       color= */
+                while (*psz_subtitle == ' ')
+                    psz_subtitle++;
+
                 while( *psz_subtitle != '>' )
                 {
                     int  k;
@@ -675,6 +679,10 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle )
                             HtmlPut( &psz_html, psz_attribs[k] );
                             psz_subtitle += i_len;
 
+                            /* <font       color=   red */
+                            while (*psz_subtitle == ' ')
+                                psz_subtitle++;
+
                             /* */
                             if( *psz_subtitle == '"' )
                             {
@@ -712,15 +720,16 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle )
                         }
                         /* Not a tag, something else we do not understand */
                         if( i_len == 0 )
-                            *psz_subtitle++;
+                            psz_subtitle++;
 
                         psz_subtitle += i_len;
                     }
+
                     while (*psz_subtitle == ' ')
                         *psz_html++ = *psz_subtitle++;
                 }
                 *psz_html++ = '>';
-                *psz_subtitle++;
+                psz_subtitle++;
             }
             else if( !strncmp( psz_subtitle, "</", 2 ))
             {



More information about the vlc-commits mailing list