shithub: libsamplerate

Download patch

ref: 6240d2560db1c0f0642a0c6e4a2dbb3cc3ae887a
parent: 99ef7651cad8bd86c521f1cb96b648e2f9d26fea
author: Erik de Castro Lopo <erikd@miles>
date: Wed Oct 27 01:54:52 EDT 2004

Restrict the src_sinc buffer to a sensible size.

--- a/src/src_sinc.c
+++ b/src/src_sinc.c
@@ -205,6 +205,7 @@
 	*/
 
 	temp_filter.b_len = 1000 + 2 * lrint (0.5 + temp_filter.coeff_len / (temp_filter.index_inc * 1.0) * SRC_MAX_RATIO) ;
+	temp_filter.b_len = MIN (temp_filter.b_len, 2048) ;
 	temp_filter.b_len *= temp_filter.channels ;
 
 	if ((filter = calloc (1, sizeof (SINC_FILTER) + sizeof (filter->buffer [0]) * (temp_filter.b_len + temp_filter.channels))) == NULL)