We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
k
getRiceGolombCode
1 parent 242fe4b commit dc4bd4cCopy full SHA for dc4bd4c
1 file changed
Sources/CSFBAudioEngine/Decoders/SFBShortenDecoder.mm
@@ -142,8 +142,12 @@ bool allocate(size_t size = 512) noexcept {
142
143
bool getRiceGolombCode(int32_t &i32, int k) noexcept {
144
#if DEBUG
145
- assert(k < 32);
+ assert(k >= 0 && k < 32);
146
#endif /* DEBUG */
147
+ if (k < 0 || k > 31) {
148
+ return false;
149
+ }
150
+
151
if (bitsAvailable_ == 0 && !refillBitBuffer()) {
152
return false;
153
}
0 commit comments