From 61ed9a874733c11642108236fd98bfdb685f378a Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 31 Jan 2014 01:36:09 +0100 Subject: 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. --- demux/demux_lavf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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), }; -- cgit v1.2.3