elk: Bounds check access to p->store

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33101>
This commit is contained in:
Matt Turner 2025-01-16 16:45:10 -05:00 committed by Marge Bot
parent 262546eb0b
commit 82330eca3c

View file

@ -1918,6 +1918,7 @@ static inline int
next_offset(struct elk_codegen *p, void *store, int offset)
{
const struct intel_device_info *devinfo = p->devinfo;
assert((char *)store + offset < (char *)p->store + p->next_insn_offset);
elk_inst *insn = (elk_inst *)((char *)store + offset);
if (elk_inst_cmpt_control(devinfo, insn))