From c8a71b5b873bf738a2675d666885336187042469 Mon Sep 17 00:00:00 2001 From: konablend Date: Wed, 17 Jun 2009 14:17:08 +0000 Subject: - secondary component of r2548: bugfix: libhb passes unaligned stack/heap buffers to ffmpeg. - use av_malloc() for format-conversion buffer. - use av_free() instead of free() for av_malloc() buffers. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2549 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/decavcodec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libhb') diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index dae2544c2..2b7ddcbaa 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -233,7 +233,7 @@ static void decavcodecClose( hb_work_object_t * w ) } if ( pv->buffer ) { - free( pv->buffer ); + av_free( pv->buffer ); pv->buffer = NULL; } free( pv ); @@ -339,7 +339,7 @@ static int decavcodecWork( hb_work_object_t * w, hb_buffer_t ** buf_in, pv->pts_next = cur; - free( bufaligned ); + av_free( bufaligned ); return HB_WORK_OK; } @@ -429,7 +429,7 @@ static int decavcodecBSInfo( hb_work_object_t *w, const hb_buffer_t *buf, } } } - free( buffer ); + av_free( buffer ); av_parser_close( parser ); hb_avcodec_close( context ); return ret; @@ -1160,7 +1160,7 @@ static void decodeAudio( hb_work_private_t *pv, uint8_t *data, int size ) NULL, 0 ); // get output buffer size (in 2-byte samples) then malloc a buffer out_size = ( out_size * 2 ) / isamp; - buffer = malloc( out_size ); + buffer = av_malloc( out_size ); // we're doing straight sample format conversion which behaves as if // there were only one channel. @@ -1194,7 +1194,7 @@ static void decodeAudio( hb_work_private_t *pv, uint8_t *data, int size ) // if we allocated a buffer for sample format conversion, free it if ( buffer != pv->buffer ) { - free( buffer ); + av_free( buffer ); } } } -- cgit v1.2.3