summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2008-09-15 15:01:08 +0000
committerjstebbins <[email protected]>2008-09-15 15:01:08 +0000
commit34327d0c37880dcc2d4f332ce291a308ce767d8d (patch)
treeb853df933250647a16e1af5a22b1e830bd3ceb37 /libhb
parent357a1d943389cb3c76bf3a2c412b6e86bf646cf7 (diff)
Fix a couple problem exposed through some valgrind testing. use of freed
memory in detelecine and use of uninitialized memory in decmpeg2 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1700 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/decmpeg2.c2
-rw-r--r--libhb/detelecine.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/libhb/decmpeg2.c b/libhb/decmpeg2.c
index 4972d0468..4c8f5009b 100644
--- a/libhb/decmpeg2.c
+++ b/libhb/decmpeg2.c
@@ -420,6 +420,8 @@ static int decmpeg2Info( hb_work_object_t *w, hb_work_info_t *info )
{
hb_work_private_t *pv = w->private_data;
+ memset( info, 0, sizeof(*info) );
+
if ( pv && pv->libmpeg2 && pv->libmpeg2->info && pv->libmpeg2->info->sequence )
{
hb_libmpeg2_t *m = pv->libmpeg2;
diff --git a/libhb/detelecine.c b/libhb/detelecine.c
index a305cb4d2..d3757cb69 100644
--- a/libhb/detelecine.c
+++ b/libhb/detelecine.c
@@ -567,15 +567,17 @@ void pullup_free_context( struct pullup_context * c )
free( c->buffers );
- f = c->head;
- do
+ f = c->head->next;
+ while( f != c->head )
{
free( f->diffs );
free( f->comb );
f = f->next;
free( f->prev );
}
- while( f != c->head );
+ free( f->diffs );
+ free( f->comb );
+ free(f);
free( c->frame );
free( c );