]> git.sesse.net Git - vlc/commitdiff
blend: extra check to avoid possible crash
authorErwan Tulou <erwan10@videolan.org>
Wed, 1 Aug 2012 23:11:57 +0000 (01:11 +0200)
committerErwan Tulou <erwan10@videolan.org>
Thu, 2 Aug 2012 00:34:14 +0000 (02:34 +0200)
modules/video_filter/blend.cpp

index 6c05d68a66d7119685d2e118615b857108646c20..ed8b023126a7aa14a2bfb1c100f2e37e76c3aa66 100644 (file)
@@ -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,