aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-10-15 16:31:15 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-05-04 18:49:27 +0200
commitff93d6f710fa95476e0e90dec6cb1303afe26e0f (patch)
tree34f342ed535e32bbee087776760ef48f980fb0c8
parenta9b8eda77306829c9165bc306aafd6e1a91f14c0 (diff)
downloadffmpeg-ff93d6f710fa95476e0e90dec6cb1303afe26e0f.tar.gz
avfilter/vf_avgblur: fix heap-buffer overflow
Fixes #8274 (cherry picked from commit f069a9c2a65bc20c3462127623127df6dfd06c5b) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavfilter/vf_avgblur.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_avgblur.c b/libavfilter/vf_avgblur.c
index 2bb2ab1ed5..b96e5a7868 100644
--- a/libavfilter/vf_avgblur.c
+++ b/libavfilter/vf_avgblur.c
@@ -149,7 +149,7 @@ static int filter_vertically_##name(AVFilterContext *ctx, void *arg, int jobnr,
\
src = s->buffer + x; \
ptr = buffer + x; \
- for (i = 0; i <= radius; i++) { \
+ for (i = 0; i + radius < height && i <= radius; i++) { \
acc += src[(i + radius) * width]; \
count++; \
ptr[i * linesize] = acc / count; \