mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 19:24:06 +00:00
Fix crash on inter frames.
- If the bitcost was 0 it would underflow for skip mode. The bitcost is now checked before decrementing.
This commit is contained in:
parent
dfc67b766a
commit
f6fead6221
|
@ -1702,7 +1702,9 @@ static double search_cu(encoder_state * const encoder_state, int x, int y, int d
|
|||
cur_cu->merged = 0;
|
||||
cur_cu->skipped = 1;
|
||||
// Selecting skip reduces bits needed to code the CU
|
||||
cur_cu->inter.bitcost--;
|
||||
if (cur_cu->inter.bitcost > 1) {
|
||||
cur_cu->inter.bitcost -= 1;
|
||||
}
|
||||
}
|
||||
lcu_set_inter(&work_tree[depth], x, y, depth, cur_cu);
|
||||
lcu_set_coeff(&work_tree[depth], x, y, depth, cur_cu);
|
||||
|
|
Loading…
Reference in a new issue