Skip to content

Commit

Permalink
Fixed segfault in deviceinfo for Vulkan.
Browse files Browse the repository at this point in the history
If we have layers after VkGraphicsSpy and VirtualSwapchain,
we would read out of bounds in a proto.
  • Loading branch information
AWoloszyn committed Jan 8, 2018
1 parent 13a00a4 commit 356b3dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/os/device/deviceinfo/cc/vk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ bool vkLayersAndExtensions(
MUST_SUCCESS(vkEnumerateInstanceExtensionProperties(l.layerName, &ext_count,
ext_props.data()));
driver->add_layers();
driver->mutable_layers(i)->set_name(l.layerName);
driver->mutable_layers(driver->layers_size() - 1)->set_name(l.layerName);
for (size_t j = 0; j < ext_props.size(); j++) {
driver->mutable_layers(i)->add_extensions(ext_props[j].extensionName);
driver->mutable_layers(driver->layers_size() - 1)->add_extensions(ext_props[j].extensionName);
}
}
// For implicit layers and ICD extensions
Expand Down

0 comments on commit 356b3dd

Please sign in to comment.