mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
softpipe: Fix the const buffer overflow check.
The size is in bytes, pos is a dword index. Fixes these asan failures (not tested in CI since we run a fraction): dEQP-GLES31.functional.shaders.opaque_type_indexing.ubo.const_expression_compute,Crash dEQP-GLES31.functional.shaders.opaque_type_indexing.ubo.const_literal_compute,Crash Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9162>
This commit is contained in:
parent
f88d03c16c
commit
e08a04a140
1 changed files with 1 additions and 1 deletions
|
|
@ -1461,7 +1461,7 @@ fetch_src_file_channel(const struct tgsi_exec_machine *mach,
|
|||
const uint constbuf = index2D->i[i];
|
||||
const int pos = index->i[i] * 4 + swizzle;
|
||||
/* const buffer bounds check */
|
||||
if (pos < 0 || pos >= (int) mach->ConstsSize[constbuf]) {
|
||||
if (pos < 0 || pos >= (int) mach->ConstsSize[constbuf] / 4) {
|
||||
if (0) {
|
||||
/* Debug: print warning */
|
||||
static int count = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue