ff_celp_lp_synthesis_filterf: check that filter_length is within the supported range
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 13 Oct 2012 01:04:23 +0000 (03:04 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 13 Oct 2012 01:32:38 +0000 (03:32 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/celp_filters.c

index 9dac77e..5e65c2e 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "avcodec.h"
 #include "celp_filters.h"
+#include "libavutil/avassert.h"
 #include "libavutil/common.h"
 
 void ff_celp_convolve_circ(int16_t* fc_out, const int16_t* fc_in,
@@ -104,6 +105,8 @@ void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs,
     c -= filter_coeffs[1] * filter_coeffs[0];
     c -= filter_coeffs[0] * b;
 
+    av_assert2((filter_length&1)==0 && filter_length>=4);
+
     old_out0 = out[-4];
     old_out1 = out[-3];
     old_out2 = out[-2];