From 7da7407b90719957792379b5fb14e5cb84a2d026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Mon, 8 Dec 2025 03:36:05 +0100 Subject: [PATCH] avfilter/vf_neighbor_opencl: add error condition when filter name doesn't match MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 1fa5e001bce15dd33c7296b4a38fd23ab81689f9) Signed-off-by: Michael Niedermayer --- libavfilter/vf_neighbor_opencl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavfilter/vf_neighbor_opencl.c b/libavfilter/vf_neighbor_opencl.c index fb40132d95..e6c4180d43 100644 --- a/libavfilter/vf_neighbor_opencl.c +++ b/libavfilter/vf_neighbor_opencl.c @@ -68,6 +68,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 "