]> git.sesse.net Git - mlt/commitdiff
Fix segfault on missing melt argument (3249982).
authorDan Dennedy <dan@dennedy.org>
Mon, 28 Mar 2011 02:25:20 +0000 (19:25 -0700)
committerDan Dennedy <dan@dennedy.org>
Mon, 28 Mar 2011 02:25:20 +0000 (19:25 -0700)
src/modules/melt/producer_melt.c

index 05b571faff88bc6131eb91fdb284826eb85f0921..05c9ea8636e6805d812454a69ced7133377270c5 100644 (file)
@@ -145,6 +145,23 @@ mlt_producer producer_melt_init( mlt_profile profile, mlt_service_type type, con
        if ( argv )
        for ( i = 0; argv[ i ] != NULL; i ++ )
        {
+               if ( argv[ i + 1 ] == NULL && (
+                       !strcmp( argv[ i ], "-attach" ) ||
+                       !strcmp( argv[ i ], "-attach-cut" ) ||
+                       !strcmp( argv[ i ], "-attach-track" ) ||
+                       !strcmp( argv[ i ], "-attach-clip" ) ||
+                       !strcmp( argv[ i ], "-repeat" ) ||
+                       !strcmp( argv[ i ], "-split" ) ||
+                       !strcmp( argv[ i ], "-join" ) ||
+                       !strcmp( argv[ i ], "-mixer" ) ||
+                       !strcmp( argv[ i ], "-mix" ) ||
+                       !strcmp( argv[ i ], "-filter" ) ||
+                       !strcmp( argv[ i ], "-transition" ) ||
+                       !strcmp( argv[ i ], "-blank" ) ) )
+               {
+                       fprintf( stderr, "Argument missing for %s.\n", argv[ i ] );
+                       break;
+               }
                if ( !strcmp( argv[ i ], "-group" ) )
                {
                        if ( mlt_properties_count( group ) != 0 )