From 556d9c6123e7f4e213d725558764ac28e1a1faa1 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Sat, 6 Nov 2010 17:22:12 +0000 Subject: [PATCH] fix windows crash and probably other random nastiness. Initializing extradata_size to non-zero makes ffmpeg think it needs to parse extradata. But in the non-broken-by-microsoft case we leave extradata as uninitialized junk. So ffmpeg parses uninitialized data and sometimes marches off into the weeds. git-svn-id: svn://localhost/HandBrake/trunk@3651 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/decavcodec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index f4975939..c40ce49e 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -960,7 +960,7 @@ static int setup_extradata( hb_work_object_t *w, hb_buffer_t *in ) { // we haven't been inflicted with M$ - allocate a little space as // a marker and return success. - pv->context->extradata_size = 16; + pv->context->extradata_size = 0; pv->context->extradata = av_malloc(pv->context->extradata_size); return 0; } @@ -1025,7 +1025,7 @@ static int decavcodecvWork( hb_work_object_t * w, hb_buffer_t ** buf_in, // if this is the first frame open the codec (we have to wait for the // first frame because of M$ VC1 braindamage). - if ( pv->context->extradata_size == 0 ) + if ( pv->context->extradata == NULL ) { if ( setup_extradata( w, in ) ) { -- 2.11.0