diff mbox series

[FFmpeg-devel] Initialize `layout_map` on declaration

Message ID CAF1j9YP9bORUopFkz-k0ERjK80ArSRore4BbKcUeoODdcWkQUQ@mail.gmail.com
State Accepted
Commit b54c7797c515dd050a39d8d00e75eab726c3c7c3
Headers show
Series [FFmpeg-devel] Initialize `layout_map` on declaration | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Xiaohan Wang (王消寒) Aug. 28, 2020, 8 p.m. UTC
Resend with @chromium.org account. Sorry for the noise.
Subject: [PATCH] Initialize `layout_map` on declaration

Without this change, it'll cause use-of-uninitialized-variable error.
---
 libavcodec/aacdec_template.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Aug. 30, 2020, 2:17 p.m. UTC | #1
On Fri, Aug 28, 2020 at 01:00:41PM -0700, Xiaohan Wang (王消寒) wrote:
> Resend with @chromium.org account. Sorry for the noise.

i think clearing the array is a good idea independant of the bug.
It makes bugs like this more repeatable and easier to debug for
example and this should have 0 speed effect.

will apply

thanks

[...]
diff mbox series

Patch

diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index e8af01b084..76fffedfcb 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -3312,7 +3312,7 @@  static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
             break;
 
         case TYPE_PCE: {
-            uint8_t layout_map[MAX_ELEM_ID*4][3];
+            uint8_t layout_map[MAX_ELEM_ID*4][3] = {{0}};
             int tags;
 
             int pushed = push_output_configuration(ac);