summaryrefslogtreecommitdiff
path: root/libavformat/webm_chunk.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-04-20 00:03:14 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-05-02 20:28:02 +0200
commit73ef1f47f59333328264a968c8fbbcfb0bf0643f (patch)
treedff26df31937e802f953cd46c2b1528dc259e961 /libavformat/webm_chunk.c
parentebd6fb23c5373858343816a4dd53726929cc36f7 (diff)
downloadffmpeg-73ef1f47f59333328264a968c8fbbcfb0bf0643f.tar.gz
lavf/webm_chunk: Respect buffer size
The last argument of av_strlcpy is supposed to contain the size of the destination buffer, but it was filled with the size of the source string, effectively negating its very purpose. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/webm_chunk.c')
-rw-r--r--libavformat/webm_chunk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c
index ec1ec4bf91..2c99753b5b 100644
--- a/libavformat/webm_chunk.c
+++ b/libavformat/webm_chunk.c
@@ -96,7 +96,7 @@ static int get_chunk_filename(AVFormatContext *s, int is_header, char *filename)
av_log(oc, AV_LOG_ERROR, "No header filename provided\n");
return AVERROR(EINVAL);
}
- av_strlcpy(filename, wc->header_filename, strlen(wc->header_filename) + 1);
+ av_strlcpy(filename, wc->header_filename, MAX_FILENAME_SIZE);
} else {
if (av_get_frame_filename(filename, MAX_FILENAME_SIZE,
s->url, wc->chunk_index - 1) < 0) {