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

Patch hide | download patch | download mbox

diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c
index 9cce88e..69c43c8 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -1843,7 +1843,7 @@  static av_cold int decode_close_mp3on4(AVCodecContext * avctx)
 static av_cold int decode_init_mp3on4(AVCodecContext * avctx)
 {
     MP3On4DecodeContext *s = avctx->priv_data;
-    MPEG4AudioConfig cfg;
+    MPEG4AudioConfig cfg = {0};
     int i;
 
     if ((avctx->extradata_size < 2) || !avctx->extradata) {