From 2df8814ae7ce3d586db833df8de75498bc9e2abf Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Sat, 20 Apr 2019 00:03:14 +0200 Subject: [PATCH] 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 Signed-off-by: Michael Niedermayer (cherry picked from commit 73ef1f47f59333328264a968c8fbbcfb0bf0643f) Signed-off-by: Michael Niedermayer --- libavformat/webm_chunk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c index 3dfef4bb0e..265e6ec845 100644 --- a/libavformat/webm_chunk.c +++ b/libavformat/webm_chunk.c @@ -93,7 +93,7 @@ static int get_chunk_filename(AVFormatContext *s, int is_header, char *filename) if (!wc->header_filename) { 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->filename, wc->chunk_index - 1) < 0) {