Commit 50c82f42 by Geoff Lang Committed by Commit Bot

Don't index into SystemInfo gpus if it's empty.

angle::GetSystemInfo may return success on some platforms without writing any entires into the gpus vector. Make sure we don't index into this vector when it's empty. Bug:chromium:1166338 Change-Id: I4cafeadf7aa9ac55b25a1afa04c8d28a2edf52e0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2628140Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 861378be
...@@ -1620,7 +1620,7 @@ void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *feature ...@@ -1620,7 +1620,7 @@ void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *feature
angle::SystemInfo systemInfo; angle::SystemInfo systemInfo;
bool isGetSystemInfoSuccess = angle::GetSystemInfo(&systemInfo); bool isGetSystemInfoSuccess = angle::GetSystemInfo(&systemInfo);
if (isGetSystemInfoSuccess) if (isGetSystemInfoSuccess && !systemInfo.gpus.empty())
{ {
vendor = systemInfo.gpus[systemInfo.activeGPUIndex].vendorId; vendor = systemInfo.gpus[systemInfo.activeGPUIndex].vendorId;
device = systemInfo.gpus[systemInfo.activeGPUIndex].deviceId; device = systemInfo.gpus[systemInfo.activeGPUIndex].deviceId;
......
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