summaryrefslogtreecommitdiffstats
path: root/demux/demux_mf.c
diff options
context:
space:
mode:
Diffstat (limited to 'demux/demux_mf.c')
-rw-r--r--demux/demux_mf.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/demux/demux_mf.c b/demux/demux_mf.c
index 236718de36..0db3fb8add 100644
--- a/demux/demux_mf.c
+++ b/demux/demux_mf.c
@@ -70,8 +70,11 @@ static int demux_mf_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds){
if (mf->streams)
entry_stream = mf->streams[mf->curr_frame];
struct stream *stream = entry_stream;
- if (!stream)
- stream = open_stream(mf->names[mf->curr_frame], demuxer->opts, NULL);
+ if (!stream) {
+ char *filename = mf->names[mf->curr_frame];
+ if (filename)
+ stream = open_stream(filename, demuxer->opts, NULL);
+ }
if (stream) {
stream_seek(stream, 0);
@@ -87,7 +90,7 @@ static int demux_mf_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds){
talloc_free(data.start);
}
- if (stream != entry_stream)
+ if (stream && stream != entry_stream)
free_stream(stream);
mf->curr_frame++;