Commit 7c85e3ed authored by Hannes Domani's avatar Hannes Domani Committed by Jean-Baptiste Kempf

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

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 25f25f54
...@@ -286,7 +286,7 @@ int OpenDemux( vlc_object_t *p_this ) ...@@ -286,7 +286,7 @@ int OpenDemux( vlc_object_t *p_this )
p_sys->p_title = NULL; p_sys->p_title = NULL;
/* Create I/O wrapper */ /* 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 ) if( !p_io_buffer )
{ {
free( psz_url ); free( psz_url );
...@@ -297,7 +297,7 @@ int OpenDemux( vlc_object_t *p_this ) ...@@ -297,7 +297,7 @@ int OpenDemux( vlc_object_t *p_this )
p_sys->ic = avformat_alloc_context(); p_sys->ic = avformat_alloc_context();
if( !p_sys->ic ) if( !p_sys->ic )
{ {
free( p_io_buffer ); av_free( p_io_buffer );
free( psz_url ); free( psz_url );
CloseDemux( p_this ); CloseDemux( p_this );
return VLC_ENOMEM; return VLC_ENOMEM;
...@@ -307,7 +307,7 @@ int OpenDemux( vlc_object_t *p_this ) ...@@ -307,7 +307,7 @@ int OpenDemux( vlc_object_t *p_this )
AVFORMAT_IOBUFFER_SIZE, 0, p_demux, IORead, NULL, IOSeek ); AVFORMAT_IOBUFFER_SIZE, 0, p_demux, IORead, NULL, IOSeek );
if( !pb ) if( !pb )
{ {
free( p_io_buffer ); av_free( p_io_buffer );
free( psz_url ); free( psz_url );
CloseDemux( p_this ); CloseDemux( p_this );
return VLC_ENOMEM; return VLC_ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment