mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 18:40:13 +01:00
brw: don't read past the end of old_src buffer in resize_sources()
In this case, num_sources is bigger than this->sources, so if we loop
up to num_sources (instead of this->sources) we'll end up reading past
the end of old_src[]. Only copy up to what we originally had.
This was found by code inspection, I'm not aware of any applications
failing due to the lack of this patch.
Fixes: d9e737212d ("intel/brw: Add a src array for the common case in fs_inst")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32600>
This commit is contained in:
parent
c7a7f0244f
commit
d4a54d4f92
1 changed files with 1 additions and 1 deletions
|
|
@ -188,7 +188,7 @@ fs_inst::resize_sources(uint8_t num_sources)
|
|||
|
||||
} else {
|
||||
new_src = new brw_reg[num_sources];
|
||||
for (unsigned i = 0; i < num_sources; i++)
|
||||
for (unsigned i = 0; i < this->sources; i++)
|
||||
new_src[i] = old_src[i];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue