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

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/getbits.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/getbits.c b/src/getbits.c
index 9eb0759..9ce629d 100644
--- a/src/getbits.c
+++ b/src/getbits.c
@@ -89,8 +89,9 @@ unsigned get_uniform(GetBits *const c, const unsigned n) {
unsigned get_vlc(GetBits *const c) {
int n_bits = 0;
- while (!get_bits(c, 1)) n_bits++;
- if (n_bits >= 32) return 0xFFFFFFFFU;
+ while (!get_bits(c, 1))
+ if (++n_bits == 32)
+ return 0xFFFFFFFFU;
return ((1 << n_bits) - 1) + get_bits(c, n_bits);
}