summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-09-02 08:02:08 +0300
committerUoti Urpala <uau@mplayer2.org>2011-09-02 08:04:52 +0300
commit5a13d47b972ec9be4d324d4ad84c20a1cf046ade (patch)
tree97d59d6fd787c1bca02e7cd2ad0f70112f2d4590
parent081e2d0b7b3e6cd95c1aad1ff454709d104ea184 (diff)
downloadmpv-5a13d47b972ec9be4d324d4ad84c20a1cf046ade.tar.bz2
mpv-5a13d47b972ec9be4d324d4ad84c20a1cf046ade.tar.xz
demux_mf: fix option value allocated with strdup
demux_mf allocated the "type" suboption of "--mf" with strdup if it was not explicitly set. This caused a crash after playing an mf:// entry. Fix to use talloc instead.
-rw-r--r--libmpdemux/demux_mf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmpdemux/demux_mf.c b/libmpdemux/demux_mf.c
index 6a463deb5e..f47a11eed6 100644
--- a/libmpdemux/demux_mf.c
+++ b/libmpdemux/demux_mf.c
@@ -23,6 +23,7 @@
#include <sys/stat.h>
#include <unistd.h>
+#include "talloc.h"
#include "config.h"
#include "mp_msg.h"
@@ -123,7 +124,7 @@ static demuxer_t* demux_open_mf(demuxer_t* demuxer){
mp_msg(MSGT_DEMUX, MSGL_INFO, "[demux_mf] file type was not set! (try -mf type=xxx)\n" );
free( mf ); return NULL;
}
- mf_type=strdup(p+1);
+ mf_type = talloc_strdup(NULL, p+1);
mp_msg(MSGT_DEMUX, MSGL_INFO, "[demux_mf] file type was not set! trying 'type=%s'...\n", mf_type);
}