[vlc-commits] [Git][videolan/vlc][master] 3 commits: substx3g: fix file name comment

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Tue Mar 4 05:37:29 UTC 2025



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
576dc574 by Johannes Kauffmann at 2025-03-04T05:23:38+00:00
substx3g: fix file name comment

- - - - -
18b1c9d8 by Johannes Kauffmann at 2025-03-04T05:23:38+00:00
substx3g: factor error handling

- - - - -
80ca615d by Johannes Kauffmann at 2025-03-04T05:23:38+00:00
substx3g: fix leak on error

- - - - -


1 changed file:

- modules/codec/substx3g.c


Changes:

=====================================
modules/codec/substx3g.c
=====================================
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * substx3gsub.c : MP4 tx3g subtitles decoder
+ * substx3g.c : MP4 tx3g subtitles decoder
  *****************************************************************************
  * Copyright (C) 2014 VLC authors and VideoLAN
  *
@@ -321,16 +321,14 @@ static int Decode( decoder_t *p_dec, block_t *p_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 VLCDEC_SUCCESS;
-    }
     else
-    {
         psz_subtitle = strndup( (const char*) p_pszstart, i_psz_bytelength );
-        if ( !psz_subtitle )
-            return VLCDEC_SUCCESS;
+
+    if ( !psz_subtitle )
+    {
+        block_Release( p_block );
+        return VLCDEC_SUCCESS;
     }
 
     for( uint16_t i=0; i < i_psz_bytelength; i++ )
@@ -344,6 +342,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
     {
         text_segment_Delete( p_segment3g->s );
         free( p_segment3g );
+        block_Release( p_block );
         return VLCDEC_SUCCESS;
     }
 
@@ -353,6 +352,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
     {
         text_segment_Delete( p_segment3g->s );
         free( p_segment3g );
+        block_Release( p_block );
         return VLCDEC_SUCCESS;
     }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d5bc46aeb1ac40564154177afaaf58362de2e0ff...80ca615d96cddb7493ef1183a32c42efc23d0cfe

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d5bc46aeb1ac40564154177afaaf58362de2e0ff...80ca615d96cddb7493ef1183a32c42efc23d0cfe
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list