[FFmpeg-devel] [PATCH] avformat/hlsenc: fix CID 1405135
Steven Liu
lq at chinaffmpeg.org
Wed Apr 26 11:43:59 EEST 2017
Fixes Coverity CID: 1405135
Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
---
libavformat/hlsenc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 3ec0f330fb..b7aafb73da 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -394,11 +394,11 @@ static int do_encrypt(AVFormatContext *s)
av_strlcat(hls->key_basename, ".key", len);
if (hls->key_url) {
- strncpy(hls->key_file, hls->key_url, sizeof(hls->key_file));
- strncpy(hls->key_uri, hls->key_url, sizeof(hls->key_uri));
+ av_strlcpy(hls->key_file, hls->key_url, sizeof(hls->key_file));
+ av_strlcpy(hls->key_uri, hls->key_url, sizeof(hls->key_uri));
} else {
- strncpy(hls->key_file, hls->key_basename, sizeof(hls->key_file));
- strncpy(hls->key_uri, hls->key_basename, sizeof(hls->key_uri));
+ av_strlcpy(hls->key_file, hls->key_basename, sizeof(hls->key_file));
+ av_strlcpy(hls->key_uri, hls->key_basename, sizeof(hls->key_uri));
}
if (!*hls->iv_string) {
--
2.11.0 (Apple Git-81)
More information about the ffmpeg-devel
mailing list