]> git.sesse.net Git - vlc/commitdiff
* modules/visualization/visual/visual.c: more sanity checks for fail over situations.
authorGildas Bazin <gbazin@videolan.org>
Sun, 18 Apr 2004 23:08:44 +0000 (23:08 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 18 Apr 2004 23:08:44 +0000 (23:08 +0000)
modules/visualization/visual/visual.c

index 4c4af5bea47f9df73c6929211a2e82306837cf18..930306c602bd0320c9746e5147b0b9ac4168e2cf 100644 (file)
@@ -202,16 +202,17 @@ static int Open( vlc_object_t *p_this )
                    msg_Err( p_filter, "Unable to parse effect list. Aborting");
                    break;
                 }
-                p_effect->psz_args = strndup( psz_parser, psz_eoa - psz_parser);
+                p_effect->psz_args =
+                    strndup( psz_parser, psz_eoa - psz_parser);
             }
+            TAB_APPEND( p_sys->i_effect, p_sys->effect, p_effect );
         }
         else
         {
-            msg_Err( p_filter, "unknown visual effect" );
+            msg_Err( p_filter, "unknown visual effect: %s", psz_parser );
+            free( p_effect );
         }
 
-        TAB_APPEND( p_sys->i_effect, p_sys->effect, p_effect );
-
         if( strchr( psz_parser, ',' ) )
         {
             psz_parser = strchr( psz_parser, ',' ) + 1;
@@ -231,6 +232,12 @@ static int Open( vlc_object_t *p_this )
         free( psz_effects );
     }
 
+    if( !p_sys->i_effect )
+    {
+        msg_Err( p_filter, "no effects found" );
+        free( p_sys );
+        return VLC_EGENERIC;
+    }
 
     /* Open the video output */
     p_sys->p_vout =