avfilter/vf_neighbor_opencl: Use AV_PIX_MAX_PLANES

Fix/Robustness/whatever: CID1439575 Out-of-bounds read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-07-08 20:16:36 +02:00
parent ace2e25720
commit 6db4e326c2
No known key found for this signature in database
GPG key ID: B18E8928B3948D64

View file

@ -42,7 +42,7 @@ typedef struct NeighborOpenCLContext {
char *matrix_str[4];
cl_float threshold[4];
cl_float threshold[AV_VIDEO_MAX_PLANES];
cl_int coordinates;
cl_mem coord;
@ -93,7 +93,7 @@ static int neighbor_opencl_make_filter_params(AVFilterContext *avctx)
cl_int cle;
int i;
for (i = 0; i < 4; i++) {
for (i = 0; i < AV_VIDEO_MAX_PLANES; i++) {
ctx->threshold[i] /= 255.0;
}