[vlc-commits] subsdec: Fix infinite loop in case of invalid closing tag

Hugo Beauzée-Luyssen git at videolan.org
Fri Nov 17 17:39:21 CET 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Fri Nov 17 16:17:31 2017 +0100| [91d83a530f96d67ffa95a0f364550834ee8013e9] | committer: Hugo Beauzée-Luyssen

subsdec: Fix infinite loop in case of invalid closing tag

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

 modules/codec/subsdec.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/codec/subsdec.c b/modules/codec/subsdec.c
index c8b82c034e..af6ec13039 100644
--- a/modules/codec/subsdec.c
+++ b/modules/codec/subsdec.c
@@ -905,6 +905,15 @@ static text_segment_t* ParseSubtitles( int *pi_align, const char *psz_subtitle )
                         psz_subtitle++;
                     free( psz_tagname );
                 }
+                else
+                {
+                    /**
+                      * This doesn't appear to be a valid tag closing syntax.
+                      * Simply append the text
+                      */
+                    AppendString( p_segment, "</" );
+                    psz_subtitle += 2;
+                }
             }
             else
             {



More information about the vlc-commits mailing list