mirror of https://git.ffmpeg.org/ffmpeg.git
avutil/opencl: add check for the program number to create kernel
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
b1dea2c0d8
commit
39406ea321
|
@ -225,6 +225,11 @@ int av_opencl_create_kernel(AVOpenCLKernelEnv *env, const char *kernel_name)
|
|||
ret = AVERROR(EINVAL);
|
||||
goto end;
|
||||
}
|
||||
if (gpu_env.program_count == 0) {
|
||||
av_log(&openclutils, AV_LOG_ERROR, "Program count of OpenCL is 0, can not create kernel\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
goto end;
|
||||
}
|
||||
for (i = 0; i < gpu_env.program_count; i++) {
|
||||
env->kernel = clCreateKernel(gpu_env.programs[i], kernel_name, &status);
|
||||
if (status == CL_SUCCESS)
|
||||
|
|
Loading…
Reference in New Issue