aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-03-30 02:16:31 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-04-01 02:58:51 +0200
commit35eeff30caf34df835206f1c12bcf4b7c2bd6758 (patch)
tree5776a8855394d9f5bf80dfffaf709a68ee31a27c
parent47b7c68ae54560e2308bdb6be4fb076c73b93081 (diff)
downloadffmpeg-35eeff30caf34df835206f1c12bcf4b7c2bd6758.tar.gz
avfilter/vf_signature: use av_strlcpy()
Fixes: out of array access Found-by: Kira <kira_cxy@foxmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavfilter/vf_signature.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/vf_signature.c b/libavfilter/vf_signature.c
index f0078ba1a6..d07b213f31 100644
--- a/libavfilter/vf_signature.c
+++ b/libavfilter/vf_signature.c
@@ -576,7 +576,8 @@ static int export(AVFilterContext *ctx, StreamContext *sc, int input)
/* error already handled */
av_assert0(av_get_frame_filename(filename, sizeof(filename), sic->filename, input) == 0);
} else {
- strcpy(filename, sic->filename);
+ if (av_strlcpy(filename, sic->filename, sizeof(filename)) >= sizeof(filename))
+ return AVERROR(EINVAL);
}
if (sic->format == FORMAT_XML) {
return xml_export(ctx, sc, filename);