Descriptioncommand_buffer: Avoid uninitialized read in ShaderTranslatorCache
The key in ShaderTranslatorCache std::map is copied with memcpy and
compared with memcmp. However, the key is a class that does not
guarantee not having any padding.
Padding in ShBuiltInResources causes the comparison be invalid. Valgrind
reports uninitialized reads for this.
Fix by preserving usage of memcmp. Initialize the object
with memset. This should write any possible padding data to a
well-defined state.
Depends on an ANGLE fix where ShBuiltInResources is similarly
initialized with memset. The resource data is copied to the key
implicitly, and this may or may not copy the padding.
Committed: https://crrev.com/d67d827a4f58eb06fecc3aa396683495bec7c0dd
Cr-Commit-Position: refs/heads/master@{#303817}
Patch Set 1 #Patch Set 2 : rebase #Patch Set 3 : rebase #Patch Set 4 : fix msvc warning on multiple assignment operators #
Messages
Total messages: 19 (8 generated)
|