[vlc-commits] Fixed out of bound writes in grain filter for non mod 8 video.

Laurent Aimar git at videolan.org
Thu Jan 12 23:02:57 CET 2012


vlc/vlc-1.2 | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Jan 12 22:14:55 2012 +0100| [e750da527545890d5021c9f0d582984c89f26156] | committer: Jean-Baptiste Kempf

Fixed out of bound writes in grain filter for non mod 8 video.
(cherry picked from commit 8473f0753678b6ddf507a0cd9f6043704464b0e7)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=e750da527545890d5021c9f0d582984c89f26156
---

 modules/video_filter/grain.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules/video_filter/grain.c b/modules/video_filter/grain.c
index a180ae3..c447876 100644
--- a/modules/video_filter/grain.c
+++ b/modules/video_filter/grain.c
@@ -241,7 +241,8 @@ static void PlaneFilter(filter_t *filter,
             if (w >= BLEND_SIZE && h >= BLEND_SIZE)
                 sys->blend(dstp, dst->i_pitch, srcp, src->i_pitch, noise);
             else
-                BlockBlend(dstp, dst->i_pitch, srcp, src->i_pitch, noise, w, h);
+                BlockBlend(dstp, dst->i_pitch, srcp, src->i_pitch, noise,
+                           __MIN(w, BLEND_SIZE), __MIN(h, BLEND_SIZE));
         }
     }
     if (sys->emms)



More information about the vlc-commits mailing list