Skip to content

Commit 1f7a2e7

Browse files
committed
Fix reading rbsp_slice_trailing_bits() in slice_layer_rbsp()
Section 7.3.2.7 from ISO/IEC 23094-1:2020 states rbsp_trailing_bits() shall be present before any potential cabac_zero_word. Signed-off-by: James Almer <jamrial@gmail.com>
1 parent ae3ac86 commit 1f7a2e7

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src_base/xevd.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,6 +1446,14 @@ int xevd_tile_eco(void * arg)
14461446
{
14471447
xevd_threadsafe_assign(&ctx->sync_row[core->y_lcu], THREAD_TERMINATED);
14481448
xevd_assert_gv(xevd_eco_tile_end_flag(bs, sbac) == 1, ret, XEVD_ERR, ERR);
1449+
u32 t0;
1450+
xevd_bsr_read1(bs, &t0);
1451+
xevd_assert_gv(1 == t0, ret, XEVD_ERR_MALFORMED_BITSTREAM, ERR);
1452+
while (!XEVD_BSR_IS_BYTE_ALIGN(bs))
1453+
{
1454+
xevd_bsr_read1(bs, &t0);
1455+
xevd_assert_gv(0 == t0, ret, XEVD_ERR_MALFORMED_BITSTREAM, ERR);
1456+
}
14491457
ret = xevd_eco_cabac_zero_word(bs);
14501458
xevd_assert_g(XEVD_SUCCEEDED(ret), ERR);
14511459
break;

0 commit comments

Comments
 (0)