- if ((get_bits_count(&h->gb) + 7) >= h->gb.size_in_bits &&
- ((get_bits_count(&h->gb) & 7) == 0 ||
- show_bits(&h->gb, -get_bits_count(&h->gb) & 7) == 0)) {
- skip_bits(&h->gb, s->next_slice_index - get_bits_count(&h->gb));
- h->gb.size_in_bits = 8 * buf_size;
-
- if (svq3_decode_slice_header(avctx))
- return -1;
+ if ((get_bits_left(&h->gb)) <= 7) {
+ if (((get_bits_count(&h->gb) & 7) == 0 ||
+ show_bits(&h->gb, get_bits_left(&h->gb) & 7) == 0)) {