> From: "Sigbjxrn Skjfret" <[EMAIL PROTECTED]>
> 
> >> Something is wrong again, as I now am experiencing random crashes again,
> >> this has been long gone, but somewhere around 3.30-3.50 it has been
> >> reintroduced. :(
> >> I'm not sure, but I believe the previous problem was due to buffer overflow
> >> or some dodgy memory allocation .. if anyone could check this out, it'd be
> >> gr8. ;)
> >I got one other report of strange crashes also.  
> 
> Ah, I believe I just discovered why this happens. ;)
> 
> >    if ( frameResults == NULL )
> >    {
> >     frameResults = (BF_FrameResults*) calloc( 1, sizeof(BF_FrameData) );
> >     assert( frameData );
> >    }
> 
> See something odd? ;)
> 
> When I replaced BF_FrameData and frameData with BF_FrameResults and
> frameResults, hey presto, no more crashes... ;))
> 

Are you sure about this?  sizeof BF_FrameData = 100, and
sizeof BF_FrameResults = 12, so what you are saying is that
calloc of 100 bytes doesn't work, but a calloc of 12 bytes fixes
the problem !!

Anyway, it is sloppy programming - using malloc() to implement
what is a static, fixed size struct, and never bothering to call free().


Mark
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to