]> git.sesse.net Git - vlc/commitdiff
motionblur: fix race condition.
authorRémi Duraffort <ivoire@videolan.org>
Tue, 20 Oct 2009 19:38:59 +0000 (21:38 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Tue, 20 Oct 2009 20:11:37 +0000 (22:11 +0200)
modules/video_filter/motionblur.c

index f5e43403136146a938f2e63507ff084cb9b3dc26..aad8946b0710e680060e009330d974d7c214cbde 100644 (file)
@@ -178,8 +178,11 @@ static void RenderBlur( filter_sys_t *p_sys, picture_t *p_newpic,
                         picture_t *p_outpic )
 {
     int i_plane;
-    int i_oldfactor = p_sys->i_factor;
+    vlc_spin_lock( &p_sys->lock );
+    const int i_oldfactor = p_sys->i_factor;
+    vlc_spin_unlock( &p_sys->lock );
     int i_newfactor = 128 - i_oldfactor;
+
     for( i_plane = 0; i_plane < p_outpic->i_planes; i_plane++ )
     {
         uint8_t *p_old, *p_new, *p_out, *p_out_end, *p_out_line_end;