Advertisement
Guest User

vlc subtitle bug

a guest
May 24th, 2017
592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.00 KB | None | 0 0
  1. --- vlc-2.2.4/modules/codec/subsdec.c   2015-02-02 19:42:29.000000000 +0000
  2. +++ vlc-2.2.5.1/modules/codec/subsdec.c 2017-04-06 15:39:47.000000000 +0100
  3. @@ -2,7 +2,7 @@
  4.   * subsdec.c : text subtitle decoder
  5.   *****************************************************************************
  6.   * Copyright (C) 2000-2006 VLC authors and VideoLAN
  7. - * $Id: 1b4276e299a2a6668047231d29ac705ae93076ba $
  8. + * $Id: addd8c71f30d53558fffd19059b374be45cf0f8e $
  9.   *
  10.   * Authors: Gildas Bazin <gbazin@videolan.org>
  11.   *          Samuel Hocevar <sam@zoy.org>
  12. @@ -664,7 +664,7 @@
  13.                  HtmlCopy( &psz_html, &psz_subtitle, "<font " );
  14.                  HtmlPut( &psz_tag, "f" );
  15.  
  16. -                while( *psz_subtitle != '>' )
  17. +                while( *psz_subtitle != '>' && *psz_subtitle)
  18.                  {
  19.                      int  k;
  20.  
  21. @@ -722,7 +722,7 @@
  22.                                  i_len++;
  23.                          }
  24.                          /* Not a tag, something else we do not understand */
  25. -                        if( i_len == 0 )
  26. +                        if( i_len == 0 && *psz_subtitle != '\0' )
  27.                              psz_subtitle++;
  28.  
  29.                          psz_subtitle += i_len;
  30. @@ -731,6 +731,7 @@
  31.                      HtmlNPut( &psz_html, psz_subtitle, strspn(psz_subtitle, " ") );
  32.                  }
  33.                  HtmlPut( &psz_html, ">" );
  34. +                if (*psz_subtitle == '\0') break;
  35.                  psz_subtitle++;
  36.              }
  37.              else if( !strncmp( psz_subtitle, "</", 2 ))
  38. @@ -912,7 +913,7 @@
  39.              }
  40.              psz_subtitle = strchr( psz_subtitle, '}' ) + 1;
  41.          }
  42. -        else if( psz_subtitle[0] == '{' &&  psz_subtitle[2] == ':' && strchr( psz_subtitle, '}' ) )
  43. +        else if( psz_subtitle[0] == '{' &&  psz_subtitle[1] != '\0' && psz_subtitle[2] == ':' && strchr( psz_subtitle, '}' ) )
  44.          {
  45.              // Hide other {x:y} atrocities, like {c:$bbggrr} or {P:x}
  46.              psz_subtitle = strchr( psz_subtitle, '}' ) + 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement