提交 3e8b8b6b 编写于 作者: J James Almer

avcodec/cbs_av1: don't call cbs_av1_read_trailing_bits() when no bits remain in the OBU

Reviewed-by: jkqxz
Signed-off-by: NJames Almer <jamrial@gmail.com>
上级 6de396c2
......@@ -1067,8 +1067,12 @@ static int cbs_av1_read_unit(CodedBitstreamContext *ctx,
if (obu->obu_size > 0 &&
obu->header.obu_type != AV1_OBU_TILE_GROUP &&
obu->header.obu_type != AV1_OBU_FRAME) {
err = cbs_av1_read_trailing_bits(ctx, &gbc,
obu->obu_size * 8 + start_pos - end_pos);
int nb_bits = obu->obu_size * 8 + start_pos - end_pos;
if (nb_bits <= 0)
return AVERROR_INVALIDDATA;
err = cbs_av1_read_trailing_bits(ctx, &gbc, nb_bits);
if (err < 0)
return err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册