Logo: expansion safety
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 19 May 2009 17:23:25 +0000 (20:23 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 19 May 2009 17:59:07 +0000 (20:59 +0300)
modules/video_filter/logo.c

index ebc137a..ba2152b 100644 (file)
@@ -346,11 +346,12 @@ static int Create( vlc_object_t *p_this )
     p_sys->pos = var_CreateGetIntegerCommand( p_vout, "logo-position" );
     p_sys->posx = var_CreateGetIntegerCommand( p_vout, "logo-x" );
     p_sys->posy = var_CreateGetIntegerCommand( p_vout, "logo-y" );
-    p_logo_list->i_delay = __MAX( __MIN(
-        var_CreateGetIntegerCommand( p_vout, "logo-delay" ) , 60000 ), 0 );
+    p_logo_list->i_delay = var_CreateGetIntegerCommand( p_vout, "logo-delay" );
+    p_logo_list->i_delay = __MAX( __MIN( p_logo_list->i_delay, 60000 ), 0 );
     p_logo_list->i_repeat = var_CreateGetIntegerCommand( p_vout, "logo-repeat");
-    p_logo_list->i_alpha = __MAX( __MIN(
-        var_CreateGetIntegerCommand( p_vout, "logo-transparency" ), 255 ), 0 );
+    p_logo_list->i_alpha = var_CreateGetIntegerCommand( p_vout,
+                                                        "logo-transparency" );
+    p_logo_list->i_alpha = __MAX( __MIN( p_logo_list->i_alpha, 255 ), 0 );
 
     LoadLogoList( p_vout, p_logo_list );
 
@@ -695,8 +696,9 @@ static int CreateFilter( vlc_object_t *p_this )
     p_sys->posx = var_CreateGetIntegerCommand( p_filter, "logo-x" );
     p_sys->posy = var_CreateGetIntegerCommand( p_filter, "logo-y" );
     p_sys->pos = var_CreateGetIntegerCommand( p_filter, "logo-position" );
-    p_logo_list->i_alpha = __MAX( __MIN( var_CreateGetIntegerCommand(
-                           p_filter, "logo-transparency"), 255 ), 0 );
+    p_logo_list->i_alpha = var_CreateGetIntegerCommand( p_filter,
+                                                        "logo-transparency");
+    p_logo_list->i_alpha = __MAX( __MIN( p_logo_list->i_alpha, 255 ), 0 );
     p_logo_list->i_delay =
         var_CreateGetIntegerCommand( p_filter, "logo-delay" );
     p_logo_list->i_repeat =