[FFmpeg-trac] #7871(avformat:new): URLs with @ in path parse incorrectly
FFmpeg
trac at avcodec.org
Sat Apr 27 19:27:46 EEST 2019
#7871: URLs with @ in path parse incorrectly
----------------------------------+--------------------------------------
Reporter: sfan5 | Type: defect
Status: new | Priority: normal
Component: avformat | Version: git-master
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
----------------------------------+--------------------------------------
Summary of the bug:
When parsing URLs that contain an @ in the path, segments of the path end
up being "eaten" as they are considered part of userinfo.
How to reproduce:
{{{
% ffprobe 'https://1liveuni-
lh.akamaihd.net/i/1LIVE_HDS at 179577/master.m3u8'
ffprobe version N-93683-g163bb087f8 Copyright (c) 2007-2019 the FFmpeg
developers
built with gcc 8.3.0 (GCC)
configuration: --prefix=/usr --disable-debug --disable-static --enable-
pic --enable-shared --enable-avresample --enable-gpl --enable-nonfree
--enable-libass --enable-libbluray --enable-libcdio --enable-libfdk-aac
--enable-fontconfig --enable-libfreetype --enable-libmp3lame --enable-
nvenc --enable-openssl --enable-libopus --enable-libpulse --enable-
libvorbis --enable-vdpau --disable-vaapi --enable-libvpx --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2
--enable-libzimg
libavutil 56. 26.100 / 56. 26.100
libavcodec 58. 52.100 / 58. 52.100
libavformat 58. 27.103 / 58. 27.103
libavdevice 58. 7.100 / 58. 7.100
libavfilter 7. 50.100 / 7. 50.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
[tcp @ 0x55846e2a5cc0] Connection to tcp://179577:443 failed: Invalid
argument
https://1liveuni-lh.akamaihd.net/i/1LIVE_HDS@179577/master.m3u8: Invalid
argument
}}}
Here, FFmpeg ends up trying to open "https://179577/master.m3u8" with the
username "1liveuni-lh.akamaihd.net/i/1LIVE_HDS", which is obviously
incorrect.
Further notes:
This issue exists since commit dd06f022b07438d650c82255dff16908ba04244a,
which was supposed to fix ticket #7816
According to the specification
https://tools.ietf.org/html/std66#appendix-A
* the "userinfo" part of an URI is '''not''' allowed to contain a slash
(as implemented by the commit above)
* the "path" part of an URI may contain a literal @ so URLs like the one
above are within the spec
--
Ticket URL: <https://trac.ffmpeg.org/ticket/7871>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list