avfilter/vf_convolution_opencl: Assert that the filter name is one of the filters

Helps with: CID1439572 Uninitialized pointer read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-06-13 00:22:11 +02:00
parent ec18ec9fc1
commit 19a5a8997c
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 3 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#include "config_components.h"
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
@ -80,6 +81,8 @@ static int convolution_opencl_init(AVFilterContext *avctx)
kernel_name = "prewitt_global";
} else if (!strcmp(avctx->filter->name, "roberts_opencl")){
kernel_name = "roberts_global";
} else {
av_assert0(0);
}
ctx->kernel = clCreateKernel(ctx->ocf.program, kernel_name, &cle);
CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to create "