diff mbox

[FFmpeg-devel,V1,6/6] lavf/matroskaenc: use initialized var for avpriv_mpeg4audio_get_config

Message ID 1569031935-8967-6-git-send-email-mypopydev@gmail.com
State New
Headers show

Commit Message

Jun Zhao Sept. 21, 2019, 2:12 a.m. UTC
From: Jun Zhao <barryjzhao@tencent.com>

avpriv_mpeg4audio_get_config will use MPEG4AudioConfig.chan_config to get
the MPEG4AudioConfig.channels, but if we use a uninitialized variable,
we will get an indeterminate channels, add an explicit initialization
for this case.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
 libavformat/matroskaenc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox


diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index cef504f..a0dc619 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -714,7 +714,7 @@  static int put_flac_codecpriv(AVFormatContext *s,
 static int get_aac_sample_rates(AVFormatContext *s, uint8_t *extradata, int extradata_size,
                                 int *sample_rate, int *output_sample_rate)
-    MPEG4AudioConfig mp4ac;
+    MPEG4AudioConfig mp4ac = {0};
     int ret;
     ret = avpriv_mpeg4audio_get_config(&mp4ac, extradata,