From: Dan Dennedy Date: Sat, 11 Jun 2011 18:15:26 +0000 (-0700) Subject: Fix bug in avformat URL parsing. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=7b1f2fec4d6a7bea788ad37ef3cab7469a16deca;p=mlt Fix bug in avformat URL parsing. Especially reproducible on file: URLs. --- diff --git a/src/modules/avformat/producer_avformat.c b/src/modules/avformat/producer_avformat.c index 536c64ba..055a75cc 100644 --- a/src/modules/avformat/producer_avformat.c +++ b/src/modules/avformat/producer_avformat.c @@ -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 );