OSDN Git Service

fix crash due to processing invalid buf_out from work
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 4 Jul 2010 18:29:27 +0000 (18:29 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 4 Jul 2010 18:29:27 +0000 (18:29 +0000)
if the work function doesn't null out buf_out (as decavcodecvWork)
then buf_out can be garbage, or worse a prevously used buffer.

I'm flabbergasted this has never bitten me before.

git-svn-id: svn://localhost/HandBrake/trunk@3426 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/work.c

index d8fc4d9..68bb6fe 100644 (file)
@@ -1181,6 +1181,9 @@ static void work_loop( void * _w )
             break;
         }
 
+        // Invalidate buf_out so that if there is no output
+        // we don't try to pass along junk.
+        buf_out = NULL;
         w->status = w->work( w, &buf_in, &buf_out );
 
         // Propagate any chapter breaks for the worker if and only if the