Fix/Robustness/whatever: CID1439575 Out-of-bounds read
Unified · Split
| @@ -42,7 +42,7 @@ typedef struct NeighborOpenCLContext { · 41 unmodified lines | ||
| 42 | 42 | |
| 43 | 43 | char *matrix_str[4]; |
| 44 | 44 | |
| 45 | − cl_float threshold[4]; | |
| 45 | + cl_float threshold[AV_VIDEO_MAX_PLANES]; | |
| 46 | 46 | cl_int coordinates; |
| 47 | 47 | cl_mem coord; |
| 48 | 48 | |
| @@ -93,7 +93,7 @@ static int neighbor_opencl_make_filter_params(AVFilterContext *avctx) · 44 unmodified lines | ||
| 93 | 93 | cl_int cle; |
| 94 | 94 | int i; |
| 95 | 95 | |
| 96 | − for (i = 0; i < 4; i++) { | |
| 96 | + for (i = 0; i < AV_VIDEO_MAX_PLANES; i++) { | |
| 97 | 97 | ctx->threshold[i] /= 255.0; |
| 98 | 98 | } |
| 99 | 99 | |