diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-05-02 20:45:14 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-11 20:18:45 +0100 |
commit | fc3faa6afec81a5595948d690fc9b80a541c2324 (patch) | |
tree | 995c33b980f6e98b022dc6a09d561921688fb0b7 /libavformat/webm_chunk.c | |
parent | 551844116395733bef2dad0452741b7e6e436bd9 (diff) | |
download | ffmpeg-fc3faa6afec81a5595948d690fc9b80a541c2324.tar.gz |
avformat/webm_chunk: Check header filename length
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3b5b977c9f96e2c3803317ad75253801bc571791)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/webm_chunk.c')
-rw-r--r-- | libavformat/webm_chunk.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c index f60696e3ad..a11036634c 100644 --- a/libavformat/webm_chunk.c +++ b/libavformat/webm_chunk.c @@ -92,11 +92,16 @@ static int get_chunk_filename(AVFormatContext *s, int is_header, char *filename) return AVERROR(EINVAL); } if (is_header) { + int len; if (!wc->header_filename) { av_log(oc, AV_LOG_ERROR, "No header filename provided\n"); return AVERROR(EINVAL); } - av_strlcpy(filename, wc->header_filename, MAX_FILENAME_SIZE); + len = av_strlcpy(filename, wc->header_filename, MAX_FILENAME_SIZE); + if (len >= MAX_FILENAME_SIZE) { + av_log(oc, AV_LOG_ERROR, "Header filename too long\n"); + return AVERROR(EINVAL); + } } else { if (av_get_frame_filename(filename, MAX_FILENAME_SIZE, s->url, wc->chunk_index - 1) < 0) { |