[vlc-commits] Subtitles: avoid infinite loop

Jean-Baptiste Kempf git at videolan.org
Sun Apr 29 22:48:27 CEST 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Apr 29 22:44:28 2012 +0200| [830c1cffef0b503f079ca9bbf93d86a58a9f926d] | committer: Jean-Baptiste Kempf

Subtitles: avoid infinite loop

Close #6720

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=830c1cffef0b503f079ca9bbf93d86a58a9f926d
---

 modules/codec/subsdec.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/modules/codec/subsdec.c b/modules/codec/subsdec.c
index a69bcf0..1a6d74d 100644
--- a/modules/codec/subsdec.c
+++ b/modules/codec/subsdec.c
@@ -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 ))
             {



More information about the vlc-commits mailing list