[vlc-commits] blend: extra check to avoid possible crash

Erwan Tulou git at videolan.org
Thu Aug 2 02:43:40 CEST 2012


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Thu Aug  2 01:11:57 2012 +0200| [6213e4acc08162a0fe1f8911a069fe42f55c767e] | committer: Erwan Tulou

blend: extra check to avoid possible crash

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

 modules/video_filter/blend.cpp |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/video_filter/blend.cpp b/modules/video_filter/blend.cpp
index 6c05d68..ed8b023 100644
--- a/modules/video_filter/blend.cpp
+++ b/modules/video_filter/blend.cpp
@@ -607,6 +607,12 @@ static void Blend(filter_t *filter,
 {
     filter_sys_t *sys = filter->p_sys;
 
+    if( x_offset < 0 || y_offset < 0 )
+    {
+        msg_Err( filter, "Blend cannot process negative offsets" );
+        return;
+    }
+
     int width  = __MIN((int)filter->fmt_out.video.i_visible_width - x_offset,
                        (int)filter->fmt_in.video.i_visible_width);
     int height = __MIN((int)filter->fmt_out.video.i_visible_height - y_offset,



More information about the vlc-commits mailing list