[vlc-commits] demux/ts: handle allocation error

Rémi Denis-Courmont git at videolan.org
Fri Dec 4 15:47:31 UTC 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Nov 30 23:54:51 2020 +0200| [9c31f2666d3a6d230239d92532d1890c94ec1b62] | committer: Rémi Denis-Courmont

demux/ts: handle allocation error

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

 modules/demux/mpeg/ts.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index 54edd253ab..9c7c4625c6 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -454,8 +454,14 @@ static int Open( vlc_object_t *p_this )
 
         p_sys->csa = csa_New();
 
-        psz_csa2 = var_CreateGetStringCommand( p_demux, "ts-csa2-ck" );
-        i_res = csa_SetCW( (vlc_object_t*)p_demux, p_sys->csa, psz_string, true );
+        if( p_sys->csa )
+        {
+            psz_csa2 = var_CreateGetStringCommand( p_demux, "ts-csa2-ck" );
+            i_res = csa_SetCW( (vlc_object_t*)p_demux, p_sys->csa, psz_string, true );
+        }
+        else
+            i_res = VLC_ENOMEM;
+
         if( i_res == VLC_SUCCESS && psz_csa2 && *psz_csa2 )
         {
             if( csa_SetCW( (vlc_object_t*)p_demux, p_sys->csa, psz_csa2, false ) != VLC_SUCCESS )



More information about the vlc-commits mailing list