From d92e9bd2bf9de0cf59f18b1ca9e565fcccaf3487 Mon Sep 17 00:00:00 2001 From: jm Date: Thu, 15 Mar 2007 23:32:36 +0000 Subject: Doing some sanity checking (just in case) on the propagated long-term prediction git-svn-id: http://svn.xiph.org/trunk/speex@12765 0101bb08-14d6-0310-b084-bc0e0c8e3800 --- libspeex/nb_celp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libspeex/nb_celp.c') diff --git a/libspeex/nb_celp.c b/libspeex/nb_celp.c index 55bba6e..24b2044 100644 --- a/libspeex/nb_celp.c +++ b/libspeex/nb_celp.c @@ -1526,7 +1526,11 @@ int nb_decode(void *state, SpeexBits *bits, void *vout) #ifdef EPIC_48K } #endif - + /* Ensuring that things aren't blowing up as would happen if e.g. an encoder is + crafting packets to make us produce NaNs and slow down the decoder (vague DoS threat). + We can probably be even more aggressive and limit to 15000 or so. */ + sanitize_values32(exc32, NEG32(QCONST32(32000,SIG_SHIFT-1)), QCONST32(32000,SIG_SHIFT-1), st->subframeSize); + tmp = gain_3tap_to_1tap(pitch_gain); pitch_average += tmp; -- cgit v1.2.3