diff mbox series

[FFmpeg-devel,4/8] avfilter/vf_neighbor_opencl: Use AV_PIX_MAX_PLANES

Message ID 20240708222410.773456-4-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/8] avfilter/vf_elbg: Use unsigned for shifting into the top bit | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer July 8, 2024, 10:24 p.m. UTC
Fix/Robustness/whatever: CID1439575 Out-of-bounds read

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavfilter/vf_neighbor_opencl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/vf_neighbor_opencl.c b/libavfilter/vf_neighbor_opencl.c
index b2939f841a2..ba661bd665e 100644
--- a/libavfilter/vf_neighbor_opencl.c
+++ b/libavfilter/vf_neighbor_opencl.c
@@ -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;
     }