1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-09 15:20:59 +00:00

Fix OpenCL platform selection

This commit is contained in:
jsteube 2015-12-31 15:25:34 +01:00
parent 06b1a1e2ae
commit 04e5ad2d54

View File

@ -12281,16 +12281,23 @@ int main (int argc, char **argv)
printf ("* %d = %s\n", i + 1, CL_platform_vendor); printf ("* %d = %s\n", i + 1, CL_platform_vendor);
} }
return (-1);
} }
else else
{ {
CL_platform_sel = atoi (gpu_platform); CL_platform_sel = atoi (gpu_platform);
}
if (CL_platform_sel > CL_platforms_cnt)
{
log_error ("ERROR: invalid OpenCL platforms selected");
return (-1); return (-1);
} }
}
}
cl_platform_id CL_platform = CL_platforms[CL_platform_sel]; cl_platform_id CL_platform = CL_platforms[CL_platform_sel - 1];
char CL_platform_vendor[INFOSZ]; char CL_platform_vendor[INFOSZ];