[vlc-commits] codec: ttml: fix memory leak on missing vout

Francois Cartegnie git at videolan.org
Fri Jan 20 21:30:07 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jan 19 21:23:43 2017 +0100| [1be33a4900605710bca8b2f30f8432cdc3e35ba7] | committer: Francois Cartegnie

codec: ttml: fix memory leak on missing vout

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

 modules/codec/ttml/substtml.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/modules/codec/ttml/substtml.c b/modules/codec/ttml/substtml.c
index 681f8f9..984f88d 100644
--- a/modules/codec/ttml/substtml.c
+++ b/modules/codec/ttml/substtml.c
@@ -704,15 +704,8 @@ static subpicture_t *ParseBlock( decoder_t *p_dec, const block_t *p_block )
     }
 
     ttml_region_t *p_regions = ParseTTML( p_dec, p_block->p_buffer, p_block->i_buffer );
-    if( p_regions )
+    if( p_regions && ( p_spu = decoder_NewSubpictureText( p_dec ) ) )
     {
-        /* Create the subpicture unit */
-        p_spu = decoder_NewSubpictureText( p_dec );
-        if( !p_spu )
-        {
-            return NULL;
-        }
-
         p_spu->i_start    = p_block->i_pts;
         p_spu->i_stop     = p_block->i_pts + p_block->i_length;
         p_spu->b_ephemer  = (p_block->i_length == 0);



More information about the vlc-commits mailing list