[FFmpeg-devel] [PATCH] libavformat/utils.c: Fixed URL parsing

Marton Balint cus at passwd.hu
Sat Feb 15 20:33:14 EET 2020



On Thu, 13 Feb 2020, Gautam Ramakrishnan wrote:

> On Thu, Feb 13, 2020 at 12:31 AM Marton Balint <cus at passwd.hu> wrote:
>>
>>
>>
>> On Wed, 12 Feb 2020, gautamramk at gmail.com wrote:
>>
>> > From: Gautam Ramakrishnan <gautamramk at gmail.com>
>> >
>> > This commit fixes bug #8466 wherein URLs with query string
>> > not preceeded by the '/' symbol in a URL was failing to get
>> > parsed. The av_url_split() function now checks if the path
>> > starts with a '/' and prepends it if it does not.
>> > ---
>> > libavformat/utils.c | 7 +++++++
>> > 1 file changed, 7 insertions(+)
>> >
>> > diff --git a/libavformat/utils.c b/libavformat/utils.c
>> > index 81ea239a66..a14d4ef90d 100644
>> > --- a/libavformat/utils.c
>> > +++ b/libavformat/utils.c
>> > @@ -4819,6 +4819,13 @@ void av_url_split(char *proto, int proto_size,
>> >         av_strlcpy(path, ls, path_size);
>> >     else
>> >         ls = &p[strlen(p)];  // XXX
>> > +    /* if path does not start with a /, prepend a / */
>> > +    if (path[0] != '/') {
>> > +        char temp[1024];
>> > +        av_strlcpy(temp, path, path_size);
>> > +        path[0] = '/';
>> > +        av_strlcpy(path + 1, temp, path_size - 1);
>> > +    }
>>
>> I made a patch which fixes this in the HTTP protocol, as modifying the
>> empty path to / is a HTTP requirement, other protocols might not need
>> this.
>>
> Oh I just found this on patchwork. I think my patch becomes redundant
> then. I guess the patch has not been merged yet?
>> http://mplayerhq.hu/pipermail/ffmpeg-devel/2020-February/256902.html

The patch is now applied.

Regards,
Marton


More information about the ffmpeg-devel mailing list