[FFmpeg-cvslog] avfilter/vf_avgblur: fix heap-buffer overflow

Paul B Mahol git at videolan.org
Wed May 4 21:29:54 EEST 2022


ffmpeg | branch: release/3.4 | Paul B Mahol <onemda at gmail.com> | Tue Oct 15 16:31:15 2019 +0200| [cde751ce49e38979626d7c31ffadc57df3d5c518] | committer: Michael Niedermayer

avfilter/vf_avgblur: fix heap-buffer overflow

Fixes #8274

(cherry picked from commit f069a9c2a65bc20c3462127623127df6dfd06c5b)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cde751ce49e38979626d7c31ffadc57df3d5c518
---

 libavfilter/vf_avgblur.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_avgblur.c b/libavfilter/vf_avgblur.c
index afd4a6ab79..3e268bb6ee 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;                                                  \



More information about the ffmpeg-cvslog mailing list