[FFmpeg-devel,V1,4/6] lavf/adtsenc: 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-4-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/adtsenc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c
index 3c2840c..8a67dad 100644
--- a/libavformat/adtsenc.c
+++ b/libavformat/adtsenc.c
@@ -49,7 +49,7 @@  static int adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, const ui
 {
     GetBitContext gb;
     PutBitContext pb;
-    MPEG4AudioConfig m4ac;
+    MPEG4AudioConfig m4ac = {0};
     int off;
 
     init_get_bits(&gb, buf, size * 8);