Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 192834 | Differences between
and this patch

Collapse All | Expand All

(-)libsndfile-1.0.17/src/flac.c (-2 / +13 lines)
Lines 57-63 flac_open (SF_PRIVATE *psf) Link Here
57
** Private static functions.
57
** Private static functions.
58
*/
58
*/
59
59
60
#define ENC_BUFFER_SIZE 4096
60
#define ENC_BUFFER_SIZE 8192
61
61
62
typedef enum
62
typedef enum
63
{	PFLAC_PCM_SHORT = 0,
63
{	PFLAC_PCM_SHORT = 0,
Lines 202-207 flac_buffer_copy (SF_PRIVATE *psf) Link Here
202
	const FLAC__int32* const *buffer = pflac->wbuffer ;
202
	const FLAC__int32* const *buffer = pflac->wbuffer ;
203
	unsigned i = 0, j, offset ;
203
	unsigned i = 0, j, offset ;
204
204
205
	/*
206
	**	frame->header.blocksize is variable and we're using a constant blocksize
207
	**	of FLAC__MAX_BLOCK_SIZE.
208
	**	Check our assumptions here.
209
	*/
210
	if (frame->header.blocksize > FLAC__MAX_BLOCK_SIZE)
211
	{	psf_log_printf (psf, "Ooops : frame->header.blocksize (%d) > FLAC__MAX_BLOCK_SIZE (%d)\n", __func__, __LINE__, frame->header.blocksize, FLAC__MAX_BLOCK_SIZE) ;
212
		psf->error = SFE_INTERNAL ;
213
		return 0 ;
214
		} ;
215
205
	if (pflac->ptr == NULL)
216
	if (pflac->ptr == NULL)
206
	{	/*
217
	{	/*
207
		**	Not sure why this code is here and not elsewhere.
218
		**	Not sure why this code is here and not elsewhere.
Lines 210-216 flac_buffer_copy (SF_PRIVATE *psf) Link Here
210
		pflac->bufferbackup = SF_TRUE ;
221
		pflac->bufferbackup = SF_TRUE ;
211
		for (i = 0 ; i < frame->header.channels ; i++)
222
		for (i = 0 ; i < frame->header.channels ; i++)
212
		{	if (pflac->rbuffer [i] == NULL)
223
		{	if (pflac->rbuffer [i] == NULL)
213
				pflac->rbuffer [i] = calloc (frame->header.blocksize, sizeof (FLAC__int32)) ;
224
				pflac->rbuffer [i] = calloc (FLAC__MAX_BLOCK_SIZE, sizeof (FLAC__int32)) ;
214
			memcpy (pflac->rbuffer [i], buffer [i], frame->header.blocksize * sizeof (FLAC__int32)) ;
225
			memcpy (pflac->rbuffer [i], buffer [i], frame->header.blocksize * sizeof (FLAC__int32)) ;
215
			} ;
226
			} ;
216
		pflac->wbuffer = (const FLAC__int32* const*) pflac->rbuffer ;
227
		pflac->wbuffer = (const FLAC__int32* const*) pflac->rbuffer ;

Return to bug 192834