[FFmpeg-devel] [PATCH V1 2/6] lavc/aac_adtstoasc: use initialized var for avpriv_mpeg4audio_get_config

Jun Zhao mypopydev at gmail.com
Sat Sep 21 05:12:11 EEST 2019


From: Jun Zhao <barryjzhao at 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 at tencent.com>
---
 libavcodec/aac_adtstoasc_bsf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/aac_adtstoasc_bsf.c b/libavcodec/aac_adtstoasc_bsf.c
index 6541b11..96e80b0 100644
--- a/libavcodec/aac_adtstoasc_bsf.c
+++ b/libavcodec/aac_adtstoasc_bsf.c
@@ -133,7 +133,7 @@ static int aac_adtstoasc_init(AVBSFContext *ctx)
 {
     /* Validate the extradata if the stream is already MPEG-4 AudioSpecificConfig */
     if (ctx->par_in->extradata) {
-        MPEG4AudioConfig mp4ac;
+        MPEG4AudioConfig mp4ac = {0};
         int ret = avpriv_mpeg4audio_get_config(&mp4ac, ctx->par_in->extradata,
                                                ctx->par_in->extradata_size * 8, 1);
         if (ret < 0) {
-- 
1.7.1



More information about the ffmpeg-devel mailing list