Commit 31b351ea authored by Robert Nagy's avatar Robert Nagy Committed by Steven Liu

avformat/hlsenc: fix baseurl missing last char

Reviewed-by: 's avatarSteven Liu <lq@onvideo.cn>
parent 894f1c39
...@@ -1921,14 +1921,11 @@ static int hls_write_header(AVFormatContext *s) ...@@ -1921,14 +1921,11 @@ static int hls_write_header(AVFormatContext *s)
} }
if (hls->baseurl) { if (hls->baseurl) {
int baseurl_len; vs->baseurl = av_strdup(hls->baseurl);
baseurl_len = strlen(hls->baseurl);
vs->baseurl = av_malloc(baseurl_len);
if (!vs->baseurl) { if (!vs->baseurl) {
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto fail; goto fail;
} }
av_strlcpy(vs->baseurl, hls->baseurl, baseurl_len);
} }
if ((hls->flags & HLS_SINGLE_FILE) && (hls->segment_type == SEGMENT_TYPE_FMP4)) { if ((hls->flags & HLS_SINGLE_FILE) && (hls->segment_type == SEGMENT_TYPE_FMP4)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment