Skip to content

Commit 21bd59c

Browse files
committed
Fix incorrect memory read when capacity changes in RD Graph.
1 parent beb798d commit 21bd59c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

servers/rendering/rendering_device_graph.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,18 +495,19 @@ void RenderingDeviceGraph::_add_command_to_graph(ResourceTracker **p_resource_tr
495495
// We add this command to the adjacency list of all commands that were reading from the entire resource.
496496
int32_t read_full_command_list_index = search_tracker->read_full_command_list_index;
497497
while (read_full_command_list_index >= 0) {
498-
const RecordedCommandListNode &command_list_node = command_list_nodes[read_full_command_list_index];
499-
if (command_list_node.command_index == p_command_index) {
498+
int32_t read_full_command_index = command_list_nodes[read_full_command_list_index].command_index;
499+
int32_t read_full_next_index = command_list_nodes[read_full_command_list_index].next_list_index;
500+
if (read_full_command_index == p_command_index) {
500501
if (!resource_has_parent) {
501502
// 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.
502503
ERR_FAIL_MSG("Command can't have itself as a dependency.");
503504
}
504505
} else {
505506
// Add this command to the adjacency list of each command that was reading this resource.
506-
_add_adjacent_command(command_list_node.command_index, p_command_index, r_command);
507+
_add_adjacent_command(read_full_command_index, p_command_index, r_command);
507508
}
508509

509-
read_full_command_list_index = command_list_node.next_list_index;
510+
read_full_command_list_index = read_full_next_index;
510511
}
511512

512513
if (!resource_has_parent) {

0 commit comments

Comments
 (0)