Re: [PATCH 2/2] libmpdemux/demux_mf: Don't crash if no paths were selected
Alexander Strasser <[email protected]> Fri, 14 May 2021 22:28:21 +0200
| Newsgroups | gmane.comp.video.mplayer.devel |
|---|---|
| Message-ID | <[email protected]> |
Committed. Alexander On 2021-04-27 09:16 +0200, Alexander Strasser wrote: > If open_mf in demux_open_mf returns an object with zero paths: > Return directly without returning a demuxer object. > > Previously we segfaulted e.g. when trying to access the first > path to guess its file type. > > Signed-off-by: Alexander Strasser <[email protected]> > --- > libmpdemux/demux_mf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libmpdemux/demux_mf.c b/libmpdemux/demux_mf.c > index 1f322cd41..68a51665f 100644 > --- a/libmpdemux/demux_mf.c > +++ b/libmpdemux/demux_mf.c > @@ -126,7 +126,7 @@ static demuxer_t* demux_open_mf(demuxer_t* demuxer){ > > > mf=open_mf(demuxer->stream->url + 5); > - if(!mf) return NULL; > + if(!mf || mf->nr_of_files == 0) return NULL; > > if(!mf_type){ > char* p=strrchr(mf->names[0],'.'); > --