[FFmpeg-devel] Re: [PATCH 4/8] libavformat/dashenc.c: fix build warning
Anton Khirnov
anton at khirnov.net
Wed Feb 24 16:09:26 EET 2021
Quoting Guo, Yejun (2021-02-20 08:22:14)
> Part of warning message:
> src/libavformat/dashenc.c: In function ‘flush_init_segment’:
> src/libavformat/dashenc.c:608:49: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size between 1 and 1024 [-Wformat-truncation=]
> snprintf(filename, sizeof(filename), "%s%s", c->dirname, os->initfile);
> ^~
> src/libavformat/dashenc.c:608:9: note: ‘snprintf’ output between 1 and 2047 bytes into a destination of size 1024
> snprintf(filename, sizeof(filename), "%s%s", c->dirname, os->initfile);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ---
> libavformat/dashenc.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
All these numbers are pretty arbitrary. Might as well make them
dynamically allocated, like AVFormatContext.url is.
--
Anton Khirnov
More information about the ffmpeg-devel
mailing list