mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 20:00:10 +01:00
radeonsi/vcn: validate fence handle before using it
Check if picture fence handle pointer is valid before using.
Fixes: 843bdd22 ('radeonsi/vcn: check fence before destroying dpb')
Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20986>
This commit is contained in:
parent
0b9972953c
commit
4eadb333a8
1 changed files with 4 additions and 2 deletions
|
|
@ -1871,7 +1871,8 @@ static unsigned rvcn_dec_dynamic_dpb_t2_message(struct radeon_decoder *dec, rvcn
|
||||||
}
|
}
|
||||||
|
|
||||||
list_for_each_entry_safe(struct rvcn_dec_dynamic_dpb_t2, d, &dec->dpb_unref_list, list) {
|
list_for_each_entry_safe(struct rvcn_dec_dynamic_dpb_t2, d, &dec->dpb_unref_list, list) {
|
||||||
dec->ws->fence_wait(dec->ws, dec->prev_fence, PIPE_DEFAULT_DECODER_FEEDBACK_TIMEOUT_NS);
|
if (dec->prev_fence)
|
||||||
|
dec->ws->fence_wait(dec->ws, dec->prev_fence, PIPE_DEFAULT_DECODER_FEEDBACK_TIMEOUT_NS);
|
||||||
list_del(&d->list);
|
list_del(&d->list);
|
||||||
si_vid_destroy_buffer(&d->dpb);
|
si_vid_destroy_buffer(&d->dpb);
|
||||||
FREE(d);
|
FREE(d);
|
||||||
|
|
@ -2908,7 +2909,8 @@ static void radeon_dec_end_frame(struct pipe_video_codec *decoder, struct pipe_v
|
||||||
|
|
||||||
dec->send_cmd(dec, target, picture);
|
dec->send_cmd(dec, target, picture);
|
||||||
flush(dec, PIPE_FLUSH_ASYNC, picture->fence);
|
flush(dec, PIPE_FLUSH_ASYNC, picture->fence);
|
||||||
dec->prev_fence = *picture->fence;
|
if (picture->fence)
|
||||||
|
dec->prev_fence = *picture->fence;
|
||||||
next_buffer(dec);
|
next_buffer(dec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue