Re[2]: [XviD-devel] Division by zero in VFW

peter ross xvid-devel@xvid.org
Thu, 24 Oct 2002 23:34:06 +1000


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

_________________________________________________________________
Unlimited Internet access -- and 2 months free!  Try MSN. 
http://resourcecenter.msn.com/access/plans/2monthsfree.asp