Commit 351307eb by David Benjamin Committed by Commit Bot

Fix potential indexing into an empty vector in ANGLE tests

The tests are failing after "Warning: incomplete system info collection" which suggests systemInfo.gpus is empty. Check for that before indexing into the vector; defaulting the active index to zero in https://chromium-review.googlesource.com/c/angle/angle/+/1925031 was not sufficient and the line still needs a bounds check. Bug: chromium:923166, chromium:1032552 Change-Id: Ic9716830403e0dfcfa5d11539537c2a39e0e2386 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1959488Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarIan Elliott <ianelliott@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Commit-Queue: Ian Elliott <ianelliott@google.com>
parent 3eaf6294
......@@ -260,7 +260,8 @@ bool IsNVIDIA()
bool IsConfigWhitelisted(const SystemInfo &systemInfo, const PlatformParameters &param)
{
VendorID vendorID = systemInfo.gpus[systemInfo.activeGPUIndex].vendorId;
VendorID vendorID =
systemInfo.gpus.empty() ? 0 : systemInfo.gpus[systemInfo.activeGPUIndex].vendorId;
// We support the default and null back-ends on every platform.
if (param.driver == GLESDriverType::AngleEGL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment