[FFmpeg-devel] [PATCH 1/2] avformat/hlsenc: Remove nonsense memset

Steven Liu lq at chinaffmpeg.org
Thu Nov 11 04:25:01 EET 2021



> 2021年11月10日 下午8:59,Andreas Rheinhardt <andreas.rheinhardt at outlook.com> 写道:
> 
> The memset here is both unnecessary (avio_read() ignores the previous
> content of the destination buffer) as well as nonsense (for a char
> buf[BUFSIZE] sizeof(buf) and sizeof(BUFSIZE) are not the same; the
> latter is sizeof(int)).
> Fixes Coverity issue #1465863.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
> libavformat/hlsenc.c | 1 -
> 1 file changed, 1 deletion(-)
> 
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 98608a834a..557cf1bee3 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -2382,7 +2382,6 @@ static int64_t append_single_file(AVFormatContext *s, VariantStream *vs)
>     }
> 
>     do {
> -        memset(buf, 0, sizeof(BUFSIZE));
>         read_byte = avio_read(vs->out, buf, BUFSIZE);
>         avio_write(vs->out_single_file, buf, read_byte);
>         if (read_byte > 0) {
> -- 
> 2.30.2
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> 

Patchset test ok,  LGTM


Thanks

Steven Liu



More information about the ffmpeg-devel mailing list