OSDN Git Service

fix windows crash and probably other random nastiness.
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 6 Nov 2010 17:22:12 +0000 (17:22 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 6 Nov 2010 17:22:12 +0000 (17:22 +0000)
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

index f497593..c40ce49 100644 (file)
@@ -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 ) )
         {