aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhighgod0401 <highgod0401@gmail.com>2013-04-04 20:09:17 +0800
committerMichael Niedermayer <michaelni@gmx.at>2013-04-04 19:25:22 +0200
commit39406ea321ce8f4c52944fa799f90ab984fed4eb (patch)
tree5de0c1cf54a49006862f64b9da9c789702fd93b5
parentb1dea2c0d8946bfebd84984df359915667eb2ff3 (diff)
downloadffmpeg-39406ea321ce8f4c52944fa799f90ab984fed4eb.tar.gz
avutil/opencl: add check for the program number to create kernel
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavutil/opencl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavutil/opencl.c b/libavutil/opencl.c
index 799425e8a5..e618829a70 100644
--- a/libavutil/opencl.c
+++ b/libavutil/opencl.c
@@ -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)