[vlc-commits] demux: avformat: check get_title allocations

Francois Cartegnie git at videolan.org
Mon Oct 30 22:19:49 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Oct 30 22:13:26 2017 +0100| [2c1bf35ed85cc95c1fabc24f88f50934a9beed88] | committer: Francois Cartegnie

demux: avformat: check get_title allocations

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

 modules/demux/avformat/demux.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index fe9c33b052..9b242b06cd 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -1113,9 +1113,11 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             if( !p_sys->p_title )
                 return VLC_EGENERIC;
 
-            *pi_int = 1;
-            *ppp_title = xmalloc( sizeof( input_title_t*) );
+            *ppp_title = malloc( sizeof( input_title_t*) );
+            if( *ppp_title == NULL )
+                return VLC_EGENERIC;
             (*ppp_title)[0] = vlc_input_title_Duplicate( p_sys->p_title );
+            *pi_int = (*ppp_title)[0] ? 1 : 0;
             *pi_title_offset = 0;
             *pi_seekpoint_offset = 0;
             return VLC_SUCCESS;



More information about the vlc-commits mailing list