Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/speexdsp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>2007-03-16 02:32:36 +0300
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>2007-03-16 02:32:36 +0300
commitd92e9bd2bf9de0cf59f18b1ca9e565fcccaf3487 (patch)
treeeee9f80bb2e5141cba634b8eec9249d4592099ca /libspeex/nb_celp.c
parent4c7f0a5ffd7ea5e52968aad1e89108e124be012b (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.c6
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;