rem: buf->data = HMalloc (dstsize);
add: if (! (mixer_driverflags & MIX_DRIVER_FAKE_DATA)) { buf->data = HMalloc (dstsize);
context: mixSDL_BufferData (mixSDL_Object bufobj, uint32 format, void* data,		uint32 size, uint32 freq){	mixSDL_Buffer *buf = (mixSDL_Buffer *) bufobj;	mixSDL_Convertion conv;	uint32 dstsize;	if (!buf || !data || !size)	{		mixSDL_SetError (buf ? MIX_INVALID_VALUE : MIX_INVALID_NAME);#ifdef DEBUG//		fprintf (stderr, "mixSDL_BufferData() called with bad param\n");#endif		return;	}	mixSDL_LockMutex (buf_mutex);		if (buf->locked)	{		mixSDL_UnlockMutex (buf_mutex);		mixSDL_SetError (MIX_INVALID_OPERATION);#ifdef DEBUG		fprintf (stderr, "mixSDL_BufferData() called "				"with locked buffer\n");#endif		return;	}	if (buf->magic != mixSDL_bufMagic)	{		mixSDL_SetError (MIX_INVALID_NAME);#ifdef DEBUG		fprintf (stderr, "mixSDL_BufferData(): not a buffer\n");#endif	}	else if (buf->state > MIX_BUF_FILLED)	{		mixSDL_SetError (MIX_INVALID_OPERATION);#ifdef DEBUG		fprintf (stderr, "mixSDL_BufferData() attempted "				"on in-use buffer\n");#endif	}	else	{		if (buf->data)			HFree (buf->data);		buf->data = 0;		buf->size = 0;		/* Store original buffer values for OpenAL compatibility */		buf->orgdata = data;		buf->orgfreq = freq;		buf->orgsize = size;		buf->orgchannels = MIX_FORMAT_CHANS (format);		buf->orgchansize = MIX_FORMAT_BPC (format);		conv.srcsamples = size / MIX_FORMAT_SAMPSIZE (format);		conv.dstsamples = (uint32)				((double)conv.srcsamples * mixer_freq / freq);						if (conv.dstsamples >				UINT32_MAX / MIX_FORMAT_SAMPSIZE (mixer_format))		{			mixSDL_SetError (MIX_INVALID_VALUE);		}		else		{			dstsize = conv.dstsamples *					MIX_FORMAT_SAMPSIZE (mixer_format);			buf->size = dstsize;			buf->data = HMalloc (dstsize);						if (format == mixer_format && freq == mixer_freq)			{				/* format identical to internal */				buf->locked = true;				mixSDL_UnlockMutex (buf_mutex);				memcpy (buf->data, data, size);				if (MIX_FORMAT_SAMPSIZE (mixer_format) == 1)				{					/* convert buffer to S8 format internally */					uint8* dst;					for (dst = buf->data; dstsize; dstsize--, dst++)						*dst ^= 0x80;				}				mixSDL_LockMutex (buf_mutex);				buf->locked = false;			}			else 			{				/* needs convertion */				conv.srcfmt = format;				conv.srcdata = data;				conv.srcsize = size;				conv.srcfreq = freq;				conv.dstfmt = mixer_format;				conv.dstdata = buf->data;				conv.dstsize = dstsize;				conv.dstfreq = mixer_freq;				buf->locked = true;				mixSDL_UnlockMutex (buf_mutex);				mixSDL_ConvertBuffer_internal (&conv);								mixSDL_LockMutex (buf_mutex);				buf->locked = false;			}			buf->state = MIX_BUF_FILLED;		}	}	mixSDL_UnlockMutex (buf_mutex);}