[FFmpeg-devel] [PATCH] avformat/http: ignore the string after char '#'

Nicolas George george at nsup.org
Wed Jan 9 15:26:53 EET 2019


Steven Liu (12019-01-09):
> fix ticket: 7660
> Because the char '#' is used for webbrowser to display, it won't present
> in URI of http request.
> 
> Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
> ---
>  libavformat/utils.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 7afef545fe..f93837a805 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -4731,6 +4731,7 @@ void av_url_split(char *proto, int proto_size,
>                    int *port_ptr, char *path, int path_size, const char *url)
>  {
>      const char *p, *ls, *ls2, *at, *at2, *col, *brk;
> +    char *bp;
>  
>      if (port_ptr)
>          *port_ptr = -1;
> @@ -4758,6 +4759,9 @@ void av_url_split(char *proto, int proto_size,
>      }
>  
>      /* separate path from hostname */
> +    bp = strchr(p, '#');
> +    if (bp)
> +        *bp = '\0';
>      ls = strchr(p, '/');
>      ls2 = strchr(p, '?');
>      if (!ls)

This invalid: p points either to url, which is const, or to NULL.

Also, I do not think the fix itself is correct: the fragment part should
not have arrived there in the first place.

Regards;

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190109/ea5ecd97/attachment.sig>


More information about the ffmpeg-devel mailing list