Fix a buffer overflow
authorRafaël Carré <funman@videolan.org>
Sun, 23 Mar 2008 22:27:26 +0000 (22:27 +0000)
committerRafaël Carré <funman@videolan.org>
Sun, 23 Mar 2008 22:27:26 +0000 (22:27 +0000)
Reported by Drew Yao

modules/codec/subtitles/subsdec.c

index a810d58..0d5081d 100644 (file)
@@ -572,7 +572,7 @@ static char *StripTags( char *psz_subtitle )
  */
 static char *CreateHtmlSubtitle( char *psz_subtitle )
 {
-    char    psz_tagStack[ 100 ];
+    char    psz_tagStack[ ( strlen( psz_subtitle ) / 3 ) + 1 ];
     size_t  i_buf_size     = strlen( psz_subtitle ) + 100;
     char   *psz_html_start = malloc( i_buf_size );