[vlc-commits] Subtitles: avoid infinite loop

Jean-Baptiste Kempf git at videolan.org
Sun Apr 29 23:49:12 CEST 2012


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

Subtitles: avoid infinite loop

Close #6720
(cherry picked from commit 830c1cffef0b503f079ca9bbf93d86a58a9f926d)

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

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

 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 6c81d93..9ae0269 100644
--- a/modules/codec/subsdec.c
+++ b/modules/codec/subsdec.c
@@ -708,12 +708,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