Module: Mesa Branch: main Commit: bf95000d74d0353fbbd4da7179c49aad4f27f168 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bf95000d74d0353fbbd4da7179c49aad4f27f168
Author: David Rosca <now...@gmail.com> Date: Tue Oct 31 17:46:43 2023 +0100 radeonsi/uvd_enc: Fix leaking session info buffer Reviewed-by: Leo Liu <leo....@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25991> --- src/gallium/drivers/radeonsi/radeon_uvd_enc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/radeonsi/radeon_uvd_enc.c b/src/gallium/drivers/radeonsi/radeon_uvd_enc.c index ae0249db583..79105887eed 100644 --- a/src/gallium/drivers/radeonsi/radeon_uvd_enc.c +++ b/src/gallium/drivers/radeonsi/radeon_uvd_enc.c @@ -212,6 +212,10 @@ static void radeon_uvd_enc_destroy(struct pipe_video_codec *encoder) enc->fb = &fb; enc->destroy(enc); flush(enc); + if (enc->si) { + si_vid_destroy_buffer(enc->si); + FREE(enc->si); + } si_vid_destroy_buffer(&fb); } @@ -290,10 +294,6 @@ struct pipe_video_codec *radeon_uvd_create_encoder(struct pipe_context *context, goto error; } - struct rvid_buffer si; - si_vid_create_buffer(enc->screen, &si, 128 * 1024, PIPE_USAGE_STAGING); - enc->si = &si; - templat.buffer_format = PIPE_FORMAT_NV12; templat.width = enc->base.width; templat.height = enc->base.height;