]> git.sesse.net Git - vlc/blobdiff - modules/codec/substx3g.c
fix teletext framing code in DVB PES packets ignored
[vlc] / modules / codec / substx3g.c
index a735f4586bceed1b82b86fb464fb59b64d097477..cce24918a8fbcf0c49c1251e3b5eb451f600888e 100644 (file)
@@ -80,9 +80,9 @@ static int ConvertFlags( int i_atomflags )
     int i_vlcstyles_flags = 0;
     if ( i_atomflags & FONT_FACE_BOLD )
         i_vlcstyles_flags |= STYLE_BOLD;
-    else if ( i_atomflags & FONT_FACE_ITALIC )
+    if ( i_atomflags & FONT_FACE_ITALIC )
         i_vlcstyles_flags |= STYLE_ITALIC;
-    else if ( i_atomflags & FONT_FACE_UNDERLINE )
+    if ( i_atomflags & FONT_FACE_UNDERLINE )
         i_vlcstyles_flags |= STYLE_UNDERLINE;
     return i_vlcstyles_flags;
 }
@@ -262,12 +262,17 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
     if ( i_psz_bytelength > 2 &&
          ( !memcmp( p_pszstart, "\xFE\xFF", 2 ) || !memcmp( p_pszstart, "\xFF\xFE", 2 ) )
        )
+    {
         psz_subtitle = FromCharset( "UTF-16", p_pszstart, i_psz_bytelength );
+        if ( !psz_subtitle ) return NULL;
+    }
     else
+    {
         psz_subtitle = malloc( i_psz_bytelength + 1 );
-    if ( !psz_subtitle ) return NULL;
-    memcpy( psz_subtitle, p_pszstart, i_psz_bytelength );
-    psz_subtitle[ i_psz_bytelength ] = '\0';
+        if ( !psz_subtitle ) return NULL;
+        memcpy( psz_subtitle, p_pszstart, i_psz_bytelength );
+        psz_subtitle[ i_psz_bytelength ] = '\0';
+    }
     p_buf += i_psz_bytelength + sizeof(uint16_t);
 
     for( uint16_t i=0; i < i_psz_bytelength; i++ )