diff options
author | wm4 <wm4@nowhere> | 2014-01-31 01:36:09 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-01-31 19:08:12 +0100 |
commit | 61ed9a874733c11642108236fd98bfdb685f378a (patch) | |
tree | 8b8ccd5c68ffd767a862f8997747d49c560013b1 | |
parent | 0801345d68a37ea9bbe1d77fd13c3cacce37723c (diff) | |
download | mpv-61ed9a874733c11642108236fd98bfdb685f378a.tar.bz2 mpv-61ed9a874733c11642108236fd98bfdb685f378a.tar.xz |
demux_lavf: fix crash with empty files
This used to work; I'm not sure when or why it regressed. When setting
AVProbeData.filename to NULL, libavformat will crash in rtp_probe() by
unconditionally accessing the string.
We used to set the filename to NULL to prevent probing by file extension
when we don't deem it as necessary. Using an empty string also works for
this purpose.
-rw-r--r-- | demux/demux_lavf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index 8147c21ffd..1d1d310247 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -251,7 +251,7 @@ static int lavf_check_file(demuxer_t *demuxer, enum demux_check check) AVProbeData avpd = { // Disable file-extension matching with normal checks - .filename = check <= DEMUX_CHECK_REQUEST ? priv->filename : NULL, + .filename = check <= DEMUX_CHECK_REQUEST ? priv->filename : "", .buf_size = 0, .buf = av_mallocz(PROBE_BUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE), }; |