[FFmpeg-devel] [PATCH] hls: fix baseurl missing last char

Steven Liu lingjiujianke at gmail.com
Fri Dec 1 12:28:21 EET 2017


2017-12-01 18:06 GMT+08:00 Robert Nagy <ronag89 at gmail.com>:
> ---
>  libavformat/hlsenc.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index cdfbf45823..dc8bf48791 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -1921,14 +1921,11 @@ static int hls_write_header(AVFormatContext *s)
>      }
>
>      if (hls->baseurl) {
> -        int baseurl_len;
> -        baseurl_len = strlen(hls->baseurl);
> -        vs->baseurl = av_malloc(baseurl_len);
> +        vs->baseurl = av_strdup(hls->baseurl);
>          if (!vs->baseurl) {
>              ret = AVERROR(ENOMEM);
>              goto fail;
>          }
> -        av_strlcpy(vs->baseurl, hls->baseurl, baseurl_len);
>      }
>
>      if ((hls->flags & HLS_SINGLE_FILE) && (hls->segment_type ==
> SEGMENT_TYPE_FMP4)) {
> --
> 2.15.0


LGTM


Thanks


More information about the ffmpeg-devel mailing list