mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-19 09:18:10 +02:00
spirv: fix resource leak in spirv shader replacement
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39512>
This commit is contained in:
parent
b45773935d
commit
e2cd37e422
1 changed files with 2 additions and 0 deletions
|
|
@ -7642,12 +7642,14 @@ spirv_to_nir(const uint32_t *words, size_t word_count,
|
|||
replacement_size = ftell(f);
|
||||
if (replacement_size == 0) {
|
||||
vtn_info("Replacement SPIR-V shader file %s is empty.", filename);
|
||||
fclose(f);
|
||||
goto no_shader_replace;
|
||||
}
|
||||
|
||||
uint32_t *replacement_words = malloc(replacement_size);
|
||||
if (replacement_words == NULL) {
|
||||
vtn_err("Failed to allocate memory for replacement SPIR-V shader %s", filename);
|
||||
fclose(f);
|
||||
goto no_shader_replace;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue