diff mbox

[FFmpeg-devel,1/2] avformat/hlsenc: fix CID 1418106

Message ID 20170918020844.17008-1-lq@chinaffmpeg.org
State Accepted
Commit 7e9cdd3f49e50ef5d8f85d3510c8f0d305671dac
Headers show

Commit Message

Steven Liu Sept. 18, 2017, 2:08 a.m. UTC
fix the "Uninitialized scalar variable (UNINIT)" problem.

Signed-off-by: Steven Liu <lq@onvideo.cn>
---
 libavformat/hlsenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Steven Liu Sept. 21, 2017, 3:12 p.m. UTC | #1
2017-09-18 10:08 GMT+08:00 Steven Liu <lq@chinaffmpeg.org>:
> fix the "Uninitialized scalar variable (UNINIT)" problem.
>
> Signed-off-by: Steven Liu <lq@onvideo.cn>
> ---
>  libavformat/hlsenc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 3a9a235514..d70a2f7ff6 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -1327,13 +1327,13 @@ static int hls_write_header(AVFormatContext *s)
>  {
>      HLSContext *hls = s->priv_data;
>      int ret, i;
> -    char *p;
> +    char *p = NULL;
>      const char *pattern = "%d.ts";
>      const char *pattern_localtime_fmt = get_default_pattern_localtime_fmt(s);
>      const char *vtt_pattern = "%d.vtt";
>      AVDictionary *options = NULL;
> -    int basename_size;
> -    int vtt_basename_size;
> +    int basename_size = 0;
> +    int vtt_basename_size = 0;
>
>      if (hls->segment_type == SEGMENT_TYPE_FMP4) {
>          pattern = "%d.m4s";
> --
> 2.11.0 (Apple Git-81)
>
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Applied


Thanks
diff mbox

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 3a9a235514..d70a2f7ff6 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1327,13 +1327,13 @@  static int hls_write_header(AVFormatContext *s)
 {
     HLSContext *hls = s->priv_data;
     int ret, i;
-    char *p;
+    char *p = NULL;
     const char *pattern = "%d.ts";
     const char *pattern_localtime_fmt = get_default_pattern_localtime_fmt(s);
     const char *vtt_pattern = "%d.vtt";
     AVDictionary *options = NULL;
-    int basename_size;
-    int vtt_basename_size;
+    int basename_size = 0;
+    int vtt_basename_size = 0;
 
     if (hls->segment_type == SEGMENT_TYPE_FMP4) {
         pattern = "%d.m4s";