loader: short cut when init with maxGpus equal to 0

This commit is contained in:
Chia-I Wu 2014-08-06 12:17:04 +08:00
parent dbdddf031f
commit e6067d1107

View File

@ -364,7 +364,7 @@ LOADER_EXPORT XGL_RESULT XGLAPI xglInitAndEnumerateGpus(const XGL_APPLICATION_IN
}
res = icd->InitAndEnumerateGpus(pAppInfo, pAllocCb, max, &n, gpus);
if (res == XGL_SUCCESS) {
if (res == XGL_SUCCESS && n) {
memcpy(pGpus + count, gpus, sizeof(*pGpus) * n);
count += n;