Skip to content

Commit cfaffb1

Browse files
highgodmichaelni
authored andcommitted
avutil/opencl: replace assert by check and error message in av_opencl_init()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
1 parent 322428c commit cfaffb1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libavutil/opencl.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,12 @@ int av_opencl_init(AVDictionary *options, AVOpenCLExternalEnv *ext_opencl_env)
554554
ret = compile_kernel_file(&gpu_env, NULL);
555555
if (ret < 0)
556556
goto end;
557-
av_assert1(gpu_env.kernel_code_count > 0);
557+
if (gpu_env.kernel_code_count <= 0) {
558+
av_log(&openclutils, AV_LOG_ERROR,
559+
"No kernel code is registered, compile kernel file failed\n");
560+
ret = AVERROR(EINVAL);
561+
goto end;
562+
}
558563
gpu_env.init_count++;
559564

560565
end:

0 commit comments

Comments
 (0)