]> git.sesse.net Git - vlc/blobdiff - modules/codec/subsdec.c
Fluidsynth: small unlikely memory leak
[vlc] / modules / codec / subsdec.c
index b10f65cdc6ddeb1cb6ab8b0a8bf67cf088add756..2d74b6384e0dc6baa4d08a1db367141ec1c4da80 100644 (file)
@@ -218,9 +218,9 @@ vlc_module_begin ()
     add_string( "subsdec-encoding", "",
                 ENCODING_TEXT, ENCODING_LONGTEXT, false )
         change_string_list( ppsz_encodings, ppsz_encoding_names, 0 )
-    add_bool( "subsdec-autodetect-utf8", true, NULL,
+    add_bool( "subsdec-autodetect-utf8", true,
               AUTODETECT_UTF8_TEXT, AUTODETECT_UTF8_LONGTEXT, false )
-    add_bool( "subsdec-formatted", true, NULL, FORMAT_TEXT, FORMAT_LONGTEXT,
+    add_bool( "subsdec-formatted", true, FORMAT_TEXT, FORMAT_LONGTEXT,
                  false )
 vlc_module_end ()
 
@@ -640,6 +640,9 @@ static char *StripTags( char *psz_subtitle )
             *psz_text++ = *psz_subtitle;
         }
 
+        /* Security fix: Account for the case where input ends early */
+        if( *psz_subtitle == '\0' ) break;
+
         psz_subtitle++;
     }
     *psz_text = '\0';
@@ -978,7 +981,7 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle )
             /* Hide {\stupidity} */
             psz_subtitle = strchr( psz_subtitle, '}' ) + 1;
         }
-        else if( psz_subtitle[0] == '{' && psz_subtitle[1] == 'Y'
+        else if( psz_subtitle[0] == '{' && ( psz_subtitle[1] == 'Y' || psz_subtitle[1] == 'y' )
                 && psz_subtitle[2] == ':' && strchr( psz_subtitle, '}' ) )
         {
             /* Hide {Y:stupidity} */