Browse Source

If there are more devices than nDevs, don't iterate over them as they may overwrite devices mapped below that with the mapping option.

Con Kolivas 13 years ago
parent
commit
e5ee9f0f8e
1 changed files with 3 additions and 0 deletions
  1. 3 0
      adl.c

+ 3 - 0
adl.c

@@ -343,6 +343,9 @@ void init_adl(int nDevs)
 		}
 	}
 
+	if (devices > nDevs)
+		devices = nDevs;
+
 	for (gpu = 0; gpu < devices; gpu++) {
 		struct gpu_adl *ga;
 		int iAdapterIndex;