]> git.sesse.net Git - vlc/commitdiff
* modules/video_filter/logo.c: couple of sanity check.
authorGildas Bazin <gbazin@videolan.org>
Sun, 19 Sep 2004 15:46:14 +0000 (15:46 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 19 Sep 2004 15:46:14 +0000 (15:46 +0000)
modules/video_filter/logo.c

index 60db1c0ead7446aba18f8921c7cd2e7a395964fa..d90cefb99ee9c49b4995d39219c23302d7c7a628 100644 (file)
@@ -110,11 +110,15 @@ static picture_t *LoadPNG( vlc_object_t *p_this )
     var_Create( p_this, "logo-file", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
     var_Get( p_this, "logo-file", &val );
     psz_filename = val.psz_string;
-    if( !psz_filename ) return 0;
+    if( !psz_filename || !*psz_filename )
+    {
+        msg_Err( p_this, "logo file not specified" );
+        return 0;
+    }
 
     if( !(file = fopen( psz_filename , "rb" )) )
     {
-        msg_Err( p_this , "logo file (%s) not found", psz_filename );
+        msg_Err( p_this, "logo file (%s) not found", psz_filename );
         free( psz_filename );
         return 0;
     }
@@ -168,7 +172,7 @@ static picture_t *LoadPNG( vlc_object_t *p_this )
 
     var_Create(p_this, "logo-transparency", VLC_VAR_INTEGER|VLC_VAR_DOINHERIT);
     var_Get( p_this, "logo-transparency", &val );
-    i_trans = val.i_int;
+    i_trans = __MAX( __MIN( val.i_int, 255 ), 0 );
 
     for( j = 0; j < (int)i_height ; j++ )
     {