[MPlayer-cvslog] r38313 - trunk/libmpdemux/demux_mf.c

al subversion at mplayerhq.hu
Fri May 14 23:26:55 EEST 2021


Author: al
Date: Fri May 14 23:26:55 2021
New Revision: 38313

Log:
libmpdemux/demux_mf: Don't crash if no paths were selected

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.

Modified:
   trunk/libmpdemux/demux_mf.c

Modified: trunk/libmpdemux/demux_mf.c
==============================================================================
--- trunk/libmpdemux/demux_mf.c	Fri May 14 22:56:16 2021	(r38312)
+++ trunk/libmpdemux/demux_mf.c	Fri May 14 23:26:55 2021	(r38313)
@@ -126,7 +126,7 @@ static demuxer_t* demux_open_mf(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],'.');


More information about the MPlayer-cvslog mailing list