[vlc-commits] codec: tx3g: missing braces

Francois Cartegnie git at videolan.org
Thu Apr 3 20:25:06 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr  3 20:23:16 2014 +0200| [ced162370d030c6c3bb0cdfe28deb129ddea9b62] | committer: Francois Cartegnie

codec: tx3g: missing braces

refs c3c6e9b81d34ab970ccc9bb22f960558acb31cb8

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

 modules/codec/substx3g.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/codec/substx3g.c b/modules/codec/substx3g.c
index b542ffc..cce2491 100644
--- a/modules/codec/substx3g.c
+++ b/modules/codec/substx3g.c
@@ -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++ )



More information about the vlc-commits mailing list