[vlc-devel] [PATCH] avformat: use av_malloc() for io buffer (fix #16379)

Hannes Domani ssbssa at yahoo.de
Thu Jan 14 19:48:19 CET 2016


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

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 14add14..424d854 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -286,7 +286,7 @@ int OpenDemux( vlc_object_t *p_this )
     p_sys->p_title = NULL;
 
     /* Create I/O wrapper */
-    unsigned char * p_io_buffer = malloc( AVFORMAT_IOBUFFER_SIZE );
+    unsigned char * p_io_buffer = av_malloc( AVFORMAT_IOBUFFER_SIZE );
     if( !p_io_buffer )
     {
         free( psz_url );
@@ -297,7 +297,7 @@ int OpenDemux( vlc_object_t *p_this )
     p_sys->ic = avformat_alloc_context();
     if( !p_sys->ic )
     {
-        free( p_io_buffer );
+        av_free( p_io_buffer );
         free( psz_url );
         CloseDemux( p_this );
         return VLC_ENOMEM;
@@ -307,7 +307,7 @@ int OpenDemux( vlc_object_t *p_this )
         AVFORMAT_IOBUFFER_SIZE, 0, p_demux, IORead, NULL, IOSeek );
     if( !pb )
     {
-        free( p_io_buffer );
+        av_free( p_io_buffer );
         free( psz_url );
         CloseDemux( p_this );
         return VLC_ENOMEM;
-- 
2.7.0



More information about the vlc-devel mailing list