Commit 19e2e01f authored by Irui Wang's avatar Irui Wang Committed by Hans Verkuil

media: mediatek: vcodec: Handle invalid encoder vsi

Handle invalid encoder vsi in vpu_enc_init to ensure the encoder
vsi is valid for future use.

Fixes: 1972e324 ("media: mediatek: vcodec: Fix possible invalid memory access for encoder")
Signed-off-by: default avatarIrui Wang <irui.wang@mediatek.com>
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 32ec99f8
......@@ -153,6 +153,11 @@ int vpu_enc_init(struct venc_vpu_inst *vpu)
return -EINVAL;
}
if (IS_ERR_OR_NULL(vpu->vsi)) {
mtk_venc_err(vpu->ctx, "invalid venc vsi");
return -EINVAL;
}
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment