From bf15adf57af3664a8dc2173689cde35167a14598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Fri, 21 Jun 2024 08:45:21 +0800 Subject: [PATCH] OpenCL (Linux): fix crashing on AlpineLinux --- src/detection/opencl/opencl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/detection/opencl/opencl.c b/src/detection/opencl/opencl.c index 3432665d4..17dfabc88 100644 --- a/src/detection/opencl/opencl.c +++ b/src/detection/opencl/opencl.c @@ -60,7 +60,8 @@ static const char* openCLHandleData(OpenCLData* data, FFOpenCLResult* result) cl_device_id deviceIDs[32]; cl_uint numDevices = (cl_uint) (sizeof(deviceIDs) / sizeof(deviceIDs[0])); - data->ffclGetDeviceIDs(platforms[iplat], CL_DEVICE_TYPE_GPU, numDevices, deviceIDs, &numDevices); + if (data->ffclGetDeviceIDs(platforms[iplat], CL_DEVICE_TYPE_GPU, numDevices, deviceIDs, &numDevices) != CL_SUCCESS) + continue; for (cl_uint idev = 0; idev < numDevices; ++idev) {