Re[2]: [XviD-devel] Division by zero in VFW
daniel smith
xvid-devel@xvid.org
Thu, 24 Oct 2002 22:54:03 +0800
if codec is memset to 0, then fbase and fincr will still be 0 when 2-pass is initialised anyway. the super-new-and-improved dev-api-3 fix just initialises fbase=25; fincr=1; at codec mallocing.
hope it works for you this time milan.
dan
----- Original Message -----
From: "peter ross" <suxen_drol@hotmail.com>
Date: Thu, 24 Oct 2002 23:34:06 +1000
To: xvid-devel@xvid.org
Subject: Re: Re[2]: [XviD-devel] Division by zero in VFW
> hey milan
>
> >I'm sorry, but your patch didn't fixed the problem.
> >compress_frames_info isn't called at all (DirectShow bug?) and
> >codec->fbase and codec->fincr are still 0.
>
> fincr and fbase are _only_ set when ICM_COMPRESS_FRAMES_INFO is
> called. if directshow/graphedit does not call this, then
> unitialized ("random") fincr and frate values are given to core.
>
> easy solution is to add "codec->frate = codec->fbase = 0;"
> after the malloc/if(codec==NULL) check in driverproc.c:DRV_OPEN.
> or, to be even safer, maybe "memset(codec,0,sizeof(CODEC));"
>
> btw, xvidcore already has default incr/base detection.
> if (pParam->fincr <= 0 || pParam->fbase <= 0) {
> pParam->fincr = 1;
> pParam->fbase = 25;
> }
>
> -- pete
--
_______________________________________________
Get your free email from http://www.astroboymail.com
Powered by Outblaze