]> git.sesse.net Git - mlt/commitdiff
producer_avformat.c: bugfix segfault when fail to open or read file in init.
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 13 Jul 2008 01:24:41 +0000 (01:24 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sun, 13 Jul 2008 01:24:41 +0000 (01:24 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1159 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/avformat/producer_avformat.c

index 8d4c591fd8fa3fd56ae345ab832b93b7c56800c2..0e438b2bf8f45debee07d2eefb482f33f4bd0138 100644 (file)
@@ -74,11 +74,13 @@ mlt_producer producer_avformat_init( mlt_profile profile, char *file )
                                mlt_producer_close( this );
                                this = NULL;
                        }
-
-                       // Close the file to release resources for large playlists - reopen later as needed
-                       mlt_properties_set_data( properties, "dummy_context", NULL, 0, NULL, NULL );
-                       mlt_properties_set_data( properties, "audio_context", NULL, 0, NULL, NULL );
-                       mlt_properties_set_data( properties, "video_context", NULL, 0, NULL, NULL );
+                       else
+                       {
+                               // Close the file to release resources for large playlists - reopen later as needed
+                               mlt_properties_set_data( properties, "dummy_context", NULL, 0, NULL, NULL );
+                               mlt_properties_set_data( properties, "audio_context", NULL, 0, NULL, NULL );
+                               mlt_properties_set_data( properties, "video_context", NULL, 0, NULL, NULL );
+                       }
                }
        }