Mac 3.8.6b5 VM posted for testing
John M McIntosh
johnmci at smalltalkconsulting.com
Tue Feb 8 08:23:12 UTC 2005
On Feb 8, 2005, at 12:07 AM, John M McIntosh wrote:
> Found it.
>
> In the Unix code sqUnixSoundMacOSX.c
>
> OSStatus bufferDataProc(AudioConverterRef inAudioConverter, UInt32
> *ioDataSize, void **outData, void *context)
> {
> ...
> if (!n1)
> {
> char empty[256];
> *ioDataSize= min(256, *ioDataSize);
> *outData= (void *)empty;
> # if (DEBUG)
> putchar('-'); fflush(stdout);
> # endif
> }
> ...
>
> One should NOT assume that char empty[256] will in fact result in a
> byte string containing 256 zero bytes, rather we get something
> not-zero, thus a buzz.
> I also wonder about the *outData = (void *) empty if *ioDataSize is
> actually < 256 bytes.
> Seems to me one should do a memset(outData,0,*ioDataSize); to ensure
> zeros and not walking off the end of a small outData buffer...
Oops not quite correct one is setting the void **outData so we just
need to point to a zero byte buffer containing enough zeros. Still
this is
a local variable returned to the caller and the processed, wonder who
or where the stack memory lurks. Mmm perhaps it should become a
static zero byte structure somewhere.
--
========================================================================
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
========================================================================
===
More information about the Squeak-dev
mailing list
|