summaryrefslogtreecommitdiff
path: root/libavformat/webm_chunk.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2018-05-13 22:14:22 +0200
committerMarton Balint <cus@passwd.hu>2018-05-15 23:09:51 +0200
commit7931e01540a142f933e7c1399fa9833bdb5e505e (patch)
tree062137ebc8c41968008d237aa6610803f732d783 /libavformat/webm_chunk.c
parent93cee87b13fdaccaac5df649d22ad6fb1d242777 (diff)
downloadffmpeg-7931e01540a142f933e7c1399fa9833bdb5e505e.tar.gz
avformat/webm_chunk: always use a static buffer for get_chunk_filename
My conversation from AVFormatContext->filename to AVFormatContext->url was wrong in this case because get_chunk_filename uses filename as an output buffer, and not as an input buffer. Fixes ticket #7188. Signed-off-by: Marton Balint <cus@passwd.hu> (cherry picked from commit 2dbe936bf7f9e0fe7e8f05e5c3b78fb1afbff164)
Diffstat (limited to 'libavformat/webm_chunk.c')
-rw-r--r--libavformat/webm_chunk.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c
index 549ec2879a..7ceb276fc4 100644
--- a/libavformat/webm_chunk.c
+++ b/libavformat/webm_chunk.c
@@ -114,6 +114,8 @@ static int webm_chunk_write_header(AVFormatContext *s)
int ret;
int i;
AVDictionary *options = NULL;
+ char oc_filename[MAX_FILENAME_SIZE];
+ char *oc_url;
// DASH Streams can only have either one track per file.
if (s->nb_streams != 1) { return AVERROR_INVALIDDATA; }
@@ -127,9 +129,13 @@ static int webm_chunk_write_header(AVFormatContext *s)
if (ret < 0)
return ret;
oc = wc->avf;
- ret = get_chunk_filename(s, 1, oc->url);
+ ret = get_chunk_filename(s, 1, oc_filename);
if (ret < 0)
return ret;
+ oc_url = av_strdup(oc_filename);
+ if (!oc_url)
+ return AVERROR(ENOMEM);
+ ff_format_set_url(oc, oc_url);
if (wc->http_method)
av_dict_set(&options, "method", wc->http_method, 0);
ret = s->io_open(s, &oc->pb, oc->url, AVIO_FLAG_WRITE, &options);