summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-12-08 23:48:54 +0000
committerjstebbins <[email protected]>2009-12-08 23:48:54 +0000
commitd0d9e2e2c6365b7f4c0a68cb70f5117d40ba2962 (patch)
tree5a5bf6e69da432057a2f4fc14aa25eeba4631e38 /libhb
parent550206d2774f6c4f9c76252a6ae986cd6269ca46 (diff)
fix buffer leak during indepth scan
and fix a couple potential leaks if the timing is just right in work loops git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3016 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/decvobsub.c5
-rw-r--r--libhb/muxcommon.c6
-rw-r--r--libhb/work.c12
3 files changed, 23 insertions, 0 deletions
diff --git a/libhb/decvobsub.c b/libhb/decvobsub.c
index c4474f9aa..1fd9d5be3 100644
--- a/libhb/decvobsub.c
+++ b/libhb/decvobsub.c
@@ -136,6 +136,10 @@ int decsubWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
void decsubClose( hb_work_object_t * w )
{
+ hb_work_private_t * pv = w->private_data;
+
+ if ( pv->buf )
+ hb_buffer_close( &pv->buf );
free( w->private_data );
}
@@ -501,6 +505,7 @@ static hb_buffer_t * Decode( hb_work_object_t * w )
* When forcing subtitles, ignore all those that don't
* have the forced flag set.
*/
+ hb_buffer_close( &pv->buf );
return NULL;
}
diff --git a/libhb/muxcommon.c b/libhb/muxcommon.c
index dbaa9c478..7ea3c7933 100644
--- a/libhb/muxcommon.c
+++ b/libhb/muxcommon.c
@@ -369,7 +369,13 @@ static void mux_loop( void * _w )
if ( buf_in == NULL )
continue;
if ( *job->die )
+ {
+ if( buf_in )
+ {
+ hb_buffer_close( &buf_in );
+ }
break;
+ }
w->status = w->work( w, &buf_in, NULL );
}
diff --git a/libhb/work.c b/libhb/work.c
index ba4ea956e..f4be983e3 100644
--- a/libhb/work.c
+++ b/libhb/work.c
@@ -922,7 +922,13 @@ static void do_job( hb_job_t * job, int cpu_count )
if ( buf_in == NULL )
continue;
if ( *job->die )
+ {
+ if( buf_in )
+ {
+ hb_buffer_close( &buf_in );
+ }
break;
+ }
w->status = w->work( w, &buf_in, &buf_out );
@@ -1120,7 +1126,13 @@ static void work_loop( void * _w )
if ( buf_in == NULL )
continue;
if ( *w->done )
+ {
+ if( buf_in )
+ {
+ hb_buffer_close( &buf_in );
+ }
break;
+ }
w->status = w->work( w, &buf_in, &buf_out );