avfilter/vf_neighbor_opencl: add error condition when filter name doesn't match

This cannot really happen, but to suppress compiler warnings, we can
just return AVERROR_BUG here.

Fixes: warning: variable 'kernel_name' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
Kacper Michajłow
2025-12-08 03:36:05 +01:00
committed by James Almer
parent 69b4474367
commit 1fa5e001bc

View File

@@ -69,6 +69,9 @@ static int neighbor_opencl_init(AVFilterContext *avctx)
kernel_name = "erosion_global";
} else if (!strcmp(avctx->filter->name, "dilation_opencl")){
kernel_name = "dilation_global";
} else {
err = AVERROR_BUG;
goto fail;
}
ctx->kernel = clCreateKernel(ctx->ocf.program, kernel_name, &cle);
CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to create "