]> git.sesse.net Git - mlt/commitdiff
Fix bug in avformat URL parsing.
authorDan Dennedy <dan@dennedy.org>
Sat, 11 Jun 2011 18:15:26 +0000 (11:15 -0700)
committerDan Dennedy <dan@dennedy.org>
Sat, 11 Jun 2011 18:15:26 +0000 (11:15 -0700)
Especially reproducible on file: URLs.

src/modules/avformat/producer_avformat.c

index 536c64ba5b3cda60b3077ec350d072828c52e55b..055a75ccd98f0047207474c1a14783f6e9b777ea 100644 (file)
@@ -615,8 +615,9 @@ static char* parse_url( mlt_profile profile, const char* URL, AVInputFormat **fo
                        }
                }
        }
+       result = strdup( result );
        free( protocol );
-       return strdup( result );
+       return result;
 }
 
 static int get_basic_info( producer_avformat self, mlt_profile profile, const char *filename )
@@ -768,13 +769,13 @@ static int producer_open( producer_avformat self, mlt_profile profile, const cha
                free( (void*) params.standard );
 
        // If successful, then try to get additional info
-       if ( !error )
+       if ( !error && self->video_format )
        {
                // Get the stream info
                error = av_find_stream_info( self->video_format ) < 0;
 
                // Continue if no error
-               if ( !error )
+               if ( !error && self->video_format )
                {
                        // Find default audio and video streams
                        find_default_streams( self );