Commit afa7310e9cf81fe7370fda660a174d5fa90722fc

Con Kolivas 2012-08-15T11:55:30

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/adl.c b/adl.c
index cd977f2..aa22002 100644
--- a/adl.c
+++ b/adl.c
@@ -339,6 +339,9 @@ void init_adl(int nDevs)
 		}
 	}
 
+	if (devices > nDevs)
+		devices = nDevs;
+
 	for (gpu = 0; gpu < devices; gpu++) {
 		struct gpu_adl *ga;
 		int iAdapterIndex;