diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2024-04-30 17:03:39 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-04-30 17:03:39 +0200 |
| commit | 4fb0c00de3953b9a7526fc1f0ec3666f8d5987a8 (patch) | |
| tree | bcd9c7df3201dd7216b8853dddbb04a020f96749 /servers/rendering/rendering_device_graph.cpp | |
| parent | 3d03d73135accba9db761f97eeb99f26f5d53919 (diff) | |
| parent | 21bd59cdaa5f1b0c410efa30c52a3da9252667fe (diff) | |
| download | redot-engine-4fb0c00de3953b9a7526fc1f0ec3666f8d5987a8.tar.gz | |
Merge pull request #91312 from DarioSamo/render_graph_asan
Fix incorrect memory read when capacity changes in RD Graph.
Diffstat (limited to 'servers/rendering/rendering_device_graph.cpp')
| -rw-r--r-- | servers/rendering/rendering_device_graph.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/servers/rendering/rendering_device_graph.cpp b/servers/rendering/rendering_device_graph.cpp index adac7ee3eb..b04f2ebbaa 100644 --- a/servers/rendering/rendering_device_graph.cpp +++ b/servers/rendering/rendering_device_graph.cpp @@ -495,18 +495,19 @@ void RenderingDeviceGraph::_add_command_to_graph(ResourceTracker **p_resource_tr // We add this command to the adjacency list of all commands that were reading from the entire resource. int32_t read_full_command_list_index = search_tracker->read_full_command_list_index; while (read_full_command_list_index >= 0) { - const RecordedCommandListNode &command_list_node = command_list_nodes[read_full_command_list_index]; - if (command_list_node.command_index == p_command_index) { + int32_t read_full_command_index = command_list_nodes[read_full_command_list_index].command_index; + int32_t read_full_next_index = command_list_nodes[read_full_command_list_index].next_list_index; + if (read_full_command_index == p_command_index) { if (!resource_has_parent) { // Only slices are allowed to be in different usages in the same command as they are guaranteed to have no overlap in the same command. ERR_FAIL_MSG("Command can't have itself as a dependency."); } } else { // Add this command to the adjacency list of each command that was reading this resource. - _add_adjacent_command(command_list_node.command_index, p_command_index, r_command); + _add_adjacent_command(read_full_command_index, p_command_index, r_command); } - read_full_command_list_index = command_list_node.next_list_index; + read_full_command_list_index = read_full_next_index; } if (!resource_has_parent) { |
