From fa50d3ac349ea62db082898febd0a0fbe90dc1dc Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin Date: Tue, 14 Dec 2010 15:02:21 -0500 Subject: [PATCH] More negative bits prevention --- libcelt/rate.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libcelt/rate.c b/libcelt/rate.c index 434c0b0f..57454849 100644 --- a/libcelt/rate.c +++ b/libcelt/rate.c @@ -207,11 +207,17 @@ static inline int interp_bits2pulses(const CELTMode *m, int start, int end, } for (i=0;i<*skip;i++) { - if (bits[codedBands-1] >= C<= alloc_floor) + { + psum = psum - bits[codedBands-1] + alloc_floor; + bits[codedBands-1] = alloc_floor; + } else if (bits[codedBands-1] < C<