Commit cfaffb1a authored by highgod0401's avatar highgod0401 Committed by Michael Niedermayer

avutil/opencl: replace assert by check and error message in av_opencl_init()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 322428c8
...@@ -554,7 +554,12 @@ int av_opencl_init(AVDictionary *options, AVOpenCLExternalEnv *ext_opencl_env) ...@@ -554,7 +554,12 @@ int av_opencl_init(AVDictionary *options, AVOpenCLExternalEnv *ext_opencl_env)
ret = compile_kernel_file(&gpu_env, NULL); ret = compile_kernel_file(&gpu_env, NULL);
if (ret < 0) if (ret < 0)
goto end; goto end;
av_assert1(gpu_env.kernel_code_count > 0); if (gpu_env.kernel_code_count <= 0) {
av_log(&openclutils, AV_LOG_ERROR,
"No kernel code is registered, compile kernel file failed\n");
ret = AVERROR(EINVAL);
goto end;
}
gpu_env.init_count++; gpu_env.init_count++;
end: end:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment