]> git.sesse.net Git - mlt/blobdiff - src/modules/avformat/producer_avformat.c
fix memleak if file fails to open
[mlt] / src / modules / avformat / producer_avformat.c
index fc21d02c0b9ec94e96728f0f08d97f9bd59361c7..263972b8744895c02b58baaaf4d32429c5914a1e 100644 (file)
@@ -199,6 +199,7 @@ mlt_producer producer_avformat_init( mlt_profile profile, const char *service, c
                                        // Clean up
                                        mlt_producer_close( producer );
                                        producer = NULL;
+                                       producer_avformat_close( self );
                                }
                                else if ( self->seekable )
                                {
@@ -1548,7 +1549,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
                        if ( ret >= 0 && pkt.stream_index == self->video_index && pkt.size > 0 )
                        {
                                // Determine time code of the packet
-                               if ( pkt.pts == AV_NOPTS_VALUE )
+                               if ( use_pts && pkt.pts == AV_NOPTS_VALUE )
                                {
                                        self->invalid_pts_counter++;
                                        if ( self->invalid_pts_counter > 20 )