[FFmpeg-cvslog] vf_boxblur: fix out-of-buffer access when h > w

Stefano Sabatini git at videolan.org
Wed Aug 3 11:21:44 CEST 2011


ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Wed Aug  3 00:01:41 2011 +0200| [a342517710690a8f113986e8d8e9d9ffabb701fe] | committer: Stefano Sabatini

vf_boxblur: fix out-of-buffer access when h > w

Increase size of the private temporary buffers from w to FFMAX(w, h),
indeed they are used also for blurring vertical lines with length h.

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

 libavfilter/vf_boxblur.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c
index 398014a..676d205 100644
--- a/libavfilter/vf_boxblur.c
+++ b/libavfilter/vf_boxblur.c
@@ -144,8 +144,8 @@ static int config_input(AVFilterLink *inlink)
     char *expr;
     int ret;
 
-    if (!(boxblur->temp[0] = av_malloc(w)) ||
-        !(boxblur->temp[1] = av_malloc(w)))
+    if (!(boxblur->temp[0] = av_malloc(FFMAX(w, h))) ||
+        !(boxblur->temp[1] = av_malloc(FFMAX(w, h))))
         return AVERROR(ENOMEM);
 
     boxblur->hsub = desc->log2_chroma_w;



More information about the ffmpeg-cvslog mailing list