amd/vpelib: fix memory corruption

[WHY]
Wrong structure size being allocated

[HOW]
fixed the structure size during allocation

Reviewed-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: Chuanyu Tseng <Chuanyu.Tseng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36433>
This commit is contained in:
Chan, Roy 2025-06-20 17:22:20 -04:00 committed by Marge Bot
parent 74c88f740f
commit 08fd9aab30

View file

@ -999,7 +999,7 @@ const struct vpe_engine *vpe_create_engine(struct vpe_init_data *params)
if (!params)
return NULL;
engine_priv = (struct vpe_engine_priv *)params->funcs.zalloc(
params->funcs.mem_ctx, sizeof(struct vpe_engine));
params->funcs.mem_ctx, sizeof(struct vpe_engine_priv));
if (engine_priv == NULL)
return NULL;
/* setup public data */