fix[hal_av1d_vdpu383]: Fix Roku player crash after seeking.

Platform: RK3576(vdpu383)
Spec: av1

Error case:
When using the Roku player, it crashes after seeking.
Because dxva->frame_refs[mapped_idx].Index == -1, cdf_buf
becomes NULL, which leads to a crash.
The deeper cause is that after seeking, playback doesn’t
start from an I-frame, so the reference frame info isn’t
ready.

Err log:
Null pointer crash stack.

Solution:
Check frame_refs index validity to avoid crashes.

Source:
test_av1_1920x1080.mp4 (Likely reproducible with other AV1 sources.)

Reported-by: Liming Xu <rimon.xu@rock-chips.com>

Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
Change-Id: Id55c2b00aa4c42eec2ccd780974e933a052864de
This commit is contained in:
Hongjin Li
2025-09-24 09:44:45 +08:00
committed by Herman Chen
parent 29521e7f4a
commit eed8ec347f

View File

@@ -2112,7 +2112,9 @@ static void vdpu383_av1d_set_cdf(Av1dHalCtx *p_hal, DXVA_PicParams_AV1 *dxva)
coeff_cdf_idx = reg_ctx->ref_info_tbl[mapped_idx].coeff_idx;
if (!dxva->coding.disable_frame_end_update_cdf &&
reg_ctx->ref_info_tbl[mapped_idx].cdf_valid) {
reg_ctx->ref_info_tbl[mapped_idx].cdf_valid &&
dxva->frame_refs[mapped_idx].Index != (CHAR)0xff &&
dxva->frame_refs[mapped_idx].Index != 0x7f) {
cdf_buf = hal_bufs_get_buf(reg_ctx->cdf_segid_bufs, dxva->frame_refs[mapped_idx].Index);
buf_tmp = cdf_buf->buf[0];
} else {