Commit 4abd6949 authored by Janne Grunau's avatar Janne Grunau Committed by Ronald S. Bultje

getbits: do not call get_bits(0) for coded value 0 in dav1d_get_vlc

Fixes clusterfuzz-testcase-minimized-dav1d_fuzzer-5669943870226432. Credits to
oss-fuzz.
parent 887c0269
......@@ -95,7 +95,7 @@ unsigned dav1d_get_vlc(GetBits *const c) {
while (!dav1d_get_bits(c, 1))
if (++n_bits == 32)
return 0xFFFFFFFFU;
return ((1 << n_bits) - 1) + dav1d_get_bits(c, n_bits);
return n_bits ? ((1 << n_bits) - 1) + dav1d_get_bits(c, n_bits) : 0;
}
static unsigned get_bits_subexp_u(GetBits *const c, const unsigned ref,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment