Merge pull request #68718 from dzil123/fix_fog_shader_buffer_overflow
Fix shader compiler asan out of bounds
This commit is contained in:
commit
a6a6af32e2
1 changed files with 20 additions and 0 deletions
|
@ -4309,8 +4309,18 @@ ShaderLanguage::DataType ShaderLanguage::get_scalar_type(DataType p_type) {
|
|||
TYPE_INT,
|
||||
TYPE_UINT,
|
||||
TYPE_FLOAT,
|
||||
TYPE_INT,
|
||||
TYPE_UINT,
|
||||
TYPE_FLOAT,
|
||||
TYPE_INT,
|
||||
TYPE_UINT,
|
||||
TYPE_FLOAT,
|
||||
TYPE_FLOAT,
|
||||
TYPE_VOID,
|
||||
};
|
||||
|
||||
static_assert(sizeof(scalar_types) / sizeof(*scalar_types) == TYPE_MAX);
|
||||
|
||||
return scalar_types[p_type];
|
||||
}
|
||||
|
||||
|
@ -4340,8 +4350,18 @@ int ShaderLanguage::get_cardinality(DataType p_type) {
|
|||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
};
|
||||
|
||||
static_assert(sizeof(cardinality_table) / sizeof(*cardinality_table) == TYPE_MAX);
|
||||
|
||||
return cardinality_table[p_type];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue