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

Hannes Domani git at videolan.org
Sat Jan 16 18:44:49 CET 2016


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

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

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 7c85e3ed843ec1974569f63d1c8e1456dd705d68)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 71aaf34..a99bdfa 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -284,7 +284,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 );
@@ -295,7 +295,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;
@@ -305,7 +305,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