]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
assert some bounds values that should never be out of bounds (or the arrays would...
authorMichael Jerris <mike@jerris.com>
Fri, 14 Dec 2007 00:43:08 +0000 (00:43 +0000)
committerMichael Jerris <mike@jerris.com>
Fri, 14 Dec 2007 00:43:08 +0000 (00:43 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6779 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_bitpack.h

index 670f26e45c09bae973859074d79e08597aa9d8df..4a9fad9c8a826ea27e0c3b51807a86d2f5714147 100644 (file)
@@ -99,10 +99,7 @@ static inline void pack_check_over(switch_bitpack_t *pack)
                pack->bits_cur = pack->over;
 
                if (pack->mode == SWITCH_BITPACK_MODE_RFC3551) {
-                       while (pack->over > 8) {
-                               pack->over -= 8;
-                       }
-                       if (pack->over > 8) return;
+                       switch_assert(pack->over <= 8);
                        this_byte &= SWITCH_BITPACKED_MASKS[pack->over];
                        this_byte <<= pack->under;
                        *pack->cur |= this_byte;