rem: if (!buf || buf->magic != mixSDL_bufMagic)
add: if (!buf || !mixSDL_CheckBufferState (buf, "mixSDL_SourceQueueBuffers"))
context: mixSDL_SourceQueueBuffers (mixSDL_Object srcobj, uint32 n,		mixSDL_Object* pbufobj){	uint32 i;	mixSDL_Object* pobj;	mixSDL_Source *src = (mixSDL_Source *) srcobj;	if (!src || !pbufobj)	{		mixSDL_SetError (MIX_INVALID_NAME);#ifdef DEBUG		fprintf (stderr, "mixSDL_SourceQueueBuffers() called "				"with null param\n");#endif		return;	}	mixSDL_LockMutex (buf_mutex);	/* check to make sure we can safely queue all buffers */	for (i = n, pobj = pbufobj; i; i--, pobj++)	{		mixSDL_Buffer *buf = (mixSDL_Buffer *) *pobj;		if (!buf || buf->magic != mixSDL_bufMagic)		{			mixSDL_SetError (MIX_INVALID_NAME);#ifdef DEBUG			fprintf (stderr, "mixSDL_SourceQueueBuffers(): not a buffer\n");#endif			break;		}		else if (buf->locked)		{			mixSDL_SetError (MIX_INVALID_OPERATION);#ifdef DEBUG			fprintf (stderr, "mixSDL_SourceQueueBuffers(): "					"locked buffer attempted\n");#endif			break;		}		else if (buf->state != MIX_BUF_FILLED)		{			mixSDL_SetError (MIX_INVALID_OPERATION);#ifdef DEBUG			fprintf (stderr, "mixSDL_SourceQueueBuffers(): "					"invalid buffer attempted\n");#endif			break;		}	}	mixSDL_UnlockMutex (buf_mutex);	if (i == 0)	{	/* all buffers checked out */		mixSDL_LockMutex (src_mutex);		mixSDL_LockMutex (buf_mutex);		if (src->magic != mixSDL_srcMagic)		{			mixSDL_SetError (MIX_INVALID_NAME);#ifdef DEBUG			fprintf (stderr, "mixSDL_SourceQueueBuffers(): not a source\n");#endif		}		else		{			for (i = n, pobj = pbufobj; i; i--, pobj++)			{				mixSDL_Buffer *buf = (mixSDL_Buffer *) *pobj;				/* add buffer to the chain */				if (src->lastqueued)					src->lastqueued->next = buf;				src->lastqueued = buf;				if (!src->firstqueued)				{					src->firstqueued = buf;					src->nextqueued = buf;				}				src->cqueued++;				buf->state = MIX_BUF_QUEUED;			}		}		mixSDL_UnlockMutex (buf_mutex);		mixSDL_UnlockMutex (src_mutex);	}}