[vlc-commits] codec: subsdec: fix variable shadowing

Francois Cartegnie git at videolan.org
Mon Dec 24 12:06:35 CET 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Dec 24 11:44:04 2018 +0100| [c05b7f263ab3660eee5b81e2e5b41899063fee80] | committer: Francois Cartegnie

codec: subsdec: fix variable shadowing

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

 modules/codec/subsdec.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/modules/codec/subsdec.c b/modules/codec/subsdec.c
index 52b6652dc2..6160b51db7 100644
--- a/modules/codec/subsdec.c
+++ b/modules/codec/subsdec.c
@@ -898,14 +898,14 @@ static text_segment_t* ParseSubtitles( int *pi_align, const char *psz_subtitle )
             }
             else if( !strncmp( psz_subtitle, "</", 2 ))
             {
-                char* psz_tagname = GetTag( &psz_subtitle, true );
-                if ( psz_tagname != NULL )
+                char* psz_closetagname = GetTag( &psz_subtitle, true );
+                if ( psz_closetagname != NULL )
                 {
-                    if ( !strcasecmp( psz_tagname, "b" ) ||
-                         !strcasecmp( psz_tagname, "i" ) ||
-                         !strcasecmp( psz_tagname, "u" ) ||
-                         !strcasecmp( psz_tagname, "s" ) ||
-                         !strcasecmp( psz_tagname, "font" ) )
+                    if ( !strcasecmp( psz_closetagname, "b" ) ||
+                         !strcasecmp( psz_closetagname, "i" ) ||
+                         !strcasecmp( psz_closetagname, "u" ) ||
+                         !strcasecmp( psz_closetagname, "s" ) ||
+                         !strcasecmp( psz_closetagname, "font" ) )
                     {
                         // A closing tag for one of the tags we handle, meaning
                         // we pushed a style onto the stack earlier
@@ -914,10 +914,10 @@ static text_segment_t* ParseSubtitles( int *pi_align, const char *psz_subtitle )
                     else
                     {
                         // Unknown closing tag. If it is closing an unknown tag, ignore it. Otherwise, display it
-                        if ( !HasTag( &p_tag_stack, psz_tagname ) )
+                        if ( !HasTag( &p_tag_stack, psz_closetagname ) )
                         {
                             AppendString( p_segment, "</" );
-                            AppendString( p_segment, psz_tagname );
+                            AppendString( p_segment, psz_closetagname );
                             AppendCharacter( p_segment, '>' );
                         }
                     }
@@ -925,7 +925,7 @@ static text_segment_t* ParseSubtitles( int *pi_align, const char *psz_subtitle )
                         psz_subtitle++;
                     if ( *psz_subtitle == '>' )
                         psz_subtitle++;
-                    free( psz_tagname );
+                    free( psz_closetagname );
                 }
                 else
                 {



More information about the vlc-commits mailing list