radeonsi/vcn: Unmap bitstream buffer in radeon_dec_destroy

If an error occured, the bitstream buffer may still be mapped when
calling radeon_dec_destroy and this would trigger assert when destroying
the bo.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32504>
This commit is contained in:
David Rosca 2024-11-26 17:34:30 +01:00 committed by Marge Bot
parent ed5794c5e3
commit 9a3a1027a6

View file

@ -2337,6 +2337,11 @@ static void radeon_dec_destroy(struct pipe_video_codec *decoder)
assert(decoder);
if (dec->bs_ptr) {
dec->ws->buffer_unmap(dec->ws, dec->bs_buffers[dec->cur_buffer].res->buf);
dec->bs_ptr = NULL;
}
if (dec->stream_type != RDECODE_CODEC_JPEG) {
map_msg_fb_it_probs_buf(dec);
rvcn_dec_message_destroy(dec);