Message ID | 20170316123134.91106-1-lq@chinaffmpeg.org |
---|---|
State | Superseded |
Headers | show |
On Thu, Mar 16, 2017 at 08:31:34PM +0800, Steven Liu wrote: > use the option set by user > > Reported-by: Lancelot Lai <laihy23@gmail.com> > Signed-off-by: Steven Liu <lq@chinaffmpeg.org> > --- > libavformat/rtmpproto.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) This causes rtmp to segfault: example: ./ffmpeg_g -rtmp_live 0 -i rtmp://127.0.0.1 file.avi [tcp @ 0x20f0b80] Connection to tcp://127.0.0.1:1935 failed: Connection refused [rtmp @ 0x20f0420] Cannot open connection tcp://127.0.0.1:1935 Program received signal SIGSEGV, Segmentation fault. 0x00000000010ffd03 in av_dict_get () (gdb) bt #0 0x00000000010ffd03 in av_dict_get () #1 0x00000000010fff6a in av_dict_set () #2 0x0000000000630976 in ffurl_connect () #3 0x0000000000631286 in ffurl_open_whitelist () #4 0x00000000006354c5 in ffio_open_whitelist () #5 0x00000000006eb2b1 in io_open_default () #6 0x00000000007460ed in avformat_open_input () #7 0x00000000004b051b in open_input_file () #8 0x00000000004ade9c in open_files.isra () #9 0x00000000004b564c in ffmpeg_parse_options () #10 0x00000000004a5a1e in main () [...]
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 5d7ad79..bbafa77 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -2604,14 +2604,14 @@ static int inject_fake_duration_metadata(RTMPContext *rt) * and 'playpath' is a file name (the rest of the path, * may be prefixed with "mp4:") */ -static int rtmp_open(URLContext *s, const char *uri, int flags) +static int rtmp_open(URLContext *s, const char *uri, int flags, AVDictionary **options) { RTMPContext *rt = s->priv_data; char proto[8], hostname[256], path[1024], auth[100], *fname; char *old_app, *qmark, *n, fname_buffer[1024]; uint8_t buf[2048]; int port; - AVDictionary *opts = NULL; + AVDictionary *opts = *options; int ret; if (rt->listen_timeout > 0) @@ -3141,7 +3141,7 @@ static const AVClass flavor##_class = { \ \ const URLProtocol ff_##flavor##_protocol = { \ .name = #flavor, \ - .url_open = rtmp_open, \ + .url_open2 = rtmp_open, \ .url_read = rtmp_read, \ .url_read_seek = rtmp_seek, \ .url_read_pause = rtmp_pause, \
use the option set by user Reported-by: Lancelot Lai <laihy23@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org> --- libavformat/rtmpproto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)