atrac3plus: Add forgotten initialization of an internal struct
authorMaxim Poliakovski <max_pole@gmx.de>
Wed, 1 Jan 2014 22:25:15 +0000 (23:25 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 2 Jan 2014 01:25:37 +0000 (02:25 +0100)
This patch also fixes trac ticket 3254.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/atrac3plus.c

index 8bb1c60..25c4f76 100644 (file)
@@ -1700,6 +1700,10 @@ static int decode_tones_info(GetBitContext *gb, Atrac3pChanUnitCtx *ctx,
     int ch_num, i, ret;
     int band_has_tones[16];
 
+    for (ch_num = 0; ch_num < num_channels; ch_num++)
+        memset(ctx->channels[ch_num].tones_info, 0,
+               sizeof(*ctx->channels[ch_num].tones_info) * ATRAC3P_SUBBANDS);
+
     ctx->waves_info->tones_present = get_bits1(gb);
     if (!ctx->waves_info->tones_present)
         return 0;