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

Hannes Domani git at videolan.org
Sat Jan 16 18:43:54 CET 2016


vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Thu Jan 14 19:48:19 2016 +0100| [7c85e3ed843ec1974569f63d1c8e1456dd705d68] | committer: Jean-Baptiste Kempf

avformat: use av_malloc() for io buffer (fix #16379)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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;



More information about the vlc-commits mailing list