diff options
author | jm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800> | 2007-03-16 02:32:36 +0300 |
---|---|---|
committer | jm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800> | 2007-03-16 02:32:36 +0300 |
commit | d92e9bd2bf9de0cf59f18b1ca9e565fcccaf3487 (patch) | |
tree | eee9f80bb2e5141cba634b8eec9249d4592099ca /libspeex/nb_celp.c | |
parent | 4c7f0a5ffd7ea5e52968aad1e89108e124be012b (diff) |
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
Diffstat (limited to 'libspeex/nb_celp.c')
-rw-r--r-- | libspeex/nb_celp.c | 6 |
1 files changed, 5 insertions, 1 deletions
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; |