resampler: limit max number of taps

Don't use more taps than the input size.
This commit is contained in:
Wim Taymans 2014-10-24 15:42:31 +02:00
parent a81d450b7e
commit b4a5001e3c

View file

@ -257,7 +257,6 @@ gst_resampler_init (GstResampler * resampler,
resampler->in_size = in_size; resampler->in_size = in_size;
resampler->out_size = out_size; resampler->out_size = out_size;
resampler->max_taps = n_taps;
resampler->n_phases = n_phases; resampler->n_phases = n_phases;
params.method = method; params.method = method;
@ -311,6 +310,12 @@ gst_resampler_init (GstResampler * resampler,
default: default:
break; break;
} }
if (n_taps > in_size)
n_taps = in_size;
resampler->max_taps = n_taps;
resampler_calculate_taps (&params); resampler_calculate_taps (&params);
#if 0 #if 0