diff --git a/libcelt/rate.c b/libcelt/rate.c index 8d587cda..bd5eb36e 100644 --- a/libcelt/rate.c +++ b/libcelt/rate.c @@ -166,6 +166,9 @@ static inline int interp_bits2pulses(const CELTMode *m, int start, int end, int for (j=start;j>ALLOC_STEPS); + /* Don't allocate more than we can actually use */ + if (tmp > 64*C<= thresh[j]) psum += tmp; else if (tmp >= 1< 64*C<