[FFmpeg-devel] [PATCH 6/8] libavformat/smoothstreamingenc.c: fix build warning
Guo, Yejun
yejun.guo at intel.com
Sat Feb 20 09:22:16 EET 2021
Part of the build message:
src/libavformat/smoothstreamingenc.c: In function ‘ism_flush’:
src/libavformat/smoothstreamingenc.c:510:49: warning: ‘/temp’ directive output may be truncated writing 5 bytes into a region of size between 1 and 1024 [-Wformat-truncation=]
snprintf(filename, sizeof(filename), "%s/temp", os->dirname);
^~~~~
src/libavformat/smoothstreamingenc.c:510:9: note: ‘snprintf’ output between 6 and 1029 bytes into a destination of size 1024
snprintf(filename, sizeof(filename), "%s/temp", os->dirname);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libavformat/smoothstreamingenc.c:538:53: warning: ‘/temp’ directive output may be truncated writing 5 bytes into a region of size between 1 and 1024 [-Wformat-truncation=]
snprintf(filename, sizeof(filename), "%s/temp", os->dirname);
^~~~~
src/libavformat/smoothstreamingenc.c:538:13: note: ‘snprintf’ output between 6 and 1029 bytes into a destination of size 1024
snprintf(filename, sizeof(filename), "%s/temp", os->dirname);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libavformat/smoothstreamingenc.c:545:63: warning: ‘/FragmentInfo(’ directive output may be truncated writing 14 bytes into a region of size between 1 and 1024 [-Wformat-truncation=]
snprintf(header_filename, sizeof(header_filename), "%s/FragmentInfo(%s=%"PRIu64")", os->dirname, os->stream_type_tag, start_ts);
^~~~~~~~~~~~~~
src/libavformat/smoothstreamingenc.c:545:60: note: using the range [0, 18446744073709551615] for directive argument
snprintf(header_filename, sizeof(header_filename), "%s/FragmentInfo(%s=%"PRIu64")", os->dirname, os->stream_type_tag, start_ts);
^~~~~~~~~~~~~~~~~~~~~~
src/libavformat/smoothstreamingenc.c:545:9: note: ‘snprintf’ output 18 or more bytes (assuming 1041) into a destination of size 1024
snprintf(header_filename, sizeof(header_filename), "%s/FragmentInfo(%s=%"PRIu64")", os->dirname, os->stream_type_tag, start_ts);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
libavformat/smoothstreamingenc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index ba5cc27ca0..397028973d 100644
--- a/libavformat/smoothstreamingenc.c
+++ b/libavformat/smoothstreamingenc.c
@@ -501,7 +501,7 @@ static int ism_flush(AVFormatContext *s, int final)
for (i = 0; i < s->nb_streams; i++) {
OutputStream *os = &c->streams[i];
- char filename[1024], target_filename[1024], header_filename[1024], curr_dirname[1024];
+ char filename[1029], target_filename[1041], header_filename[1041], curr_dirname[1024];
int64_t size;
int64_t start_ts, duration, moof_size;
if (!os->packets_written)
--
2.17.1
More information about the ffmpeg-devel
mailing list