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

Submitted by Jun Zhao on Sept. 21, 2019, 2:12 a.m.

Details

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

Commit Message

Jun Zhao Sept. 21, 2019, 2:12 a.m.
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/latmenc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavformat/latmenc.c b/libavformat/latmenc.c
index 8eb219f..e227e13 100644
--- a/libavformat/latmenc.c
+++ b/libavformat/latmenc.c
@@ -55,7 +55,7 @@  static const AVClass latm_muxer_class = {
 
 static int latm_decode_extradata(LATMContext *ctx, uint8_t *buf, int size)
 {
-    MPEG4AudioConfig m4ac;
+    MPEG4AudioConfig m4ac = {0};
 
     if (size > MAX_EXTRADATA_SIZE) {
         av_log(ctx, AV_LOG_ERROR, "Extradata is larger than currently supported.\n");