summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-11-10 23:29:23 +0000
committerjstebbins <[email protected]>2011-11-10 23:29:23 +0000
commit750d871269cef0724c68db7f3f8105a7bf5f99c8 (patch)
treeb22523b92e2b941af803ea2c965d80078d08f4c8
parent7ba6de82aceb432422a3fdc38e58c77e6da380c1 (diff)
Fix closed captioning crash
Prevent the same CC buffer from being attached to multiple tags. The same buffer would get pushed to a fifo multiple times and ultimately freed multiple times. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4345 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/decmpeg2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libhb/decmpeg2.c b/libhb/decmpeg2.c
index 3c84fea50..f37ee9022 100644
--- a/libhb/decmpeg2.c
+++ b/libhb/decmpeg2.c
@@ -242,6 +242,9 @@ static void extract_mpeg2_captions( hb_libmpeg2_t *m )
static void next_tag( hb_libmpeg2_t *m, hb_buffer_t *buf_es )
{
+ if( m->tags[m->cur_tag].cc_buf == m->last_cc1_buf )
+ m->last_cc1_buf = NULL;
+
m->cur_tag = ( m->cur_tag + 1 ) & (NTAGS-1);
if ( m->tags[m->cur_tag].start >= 0 || m->tags[m->cur_tag].cc_buf )
{