libavcodec/ac3dec.c:308: error: Buffer Overrun L3
  Offset: [-1, +oo] Size: 6 by call to `ff_eac3_parse_header`.

libavcodec/ac3dec.c:264:11: Call
262.     int err;
263. 
264.     err = avpriv_ac3_parse_header(&s->gbc, &hdr);
               ^
265.     if(err)
266.         return err;

libavcodec/ac3_parser.c:38:1: Parameter `hdr->num_blocks`
  36. 
  37. 
  38. int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)
      ^
  39. {
  40.     int frame_size_code;

libavcodec/ac3dec.c:283:5: Assignment
281.     s->center_mix_level             = hdr.center_mix_level;
282.     s->surround_mix_level           = hdr.surround_mix_level;
283.     s->num_blocks                   = hdr.num_blocks;
         ^
284.     s->frame_type                   = hdr.frame_type;
285.     s->substreamid                  = hdr.substreamid;

libavcodec/ac3dec.c:308:16: Call
306.     } else if (CONFIG_EAC3_DECODER) {
307.         s->eac3 = 1;
308.         return ff_eac3_parse_header(s);
                    ^
309.     } else {
310.         av_log(s->avctx, AV_LOG_ERROR, "E-AC-3 support not compiled in\n");

libavcodec/eac3dec.c:291:1: <Offset trace>
289. }
290. 
291. int ff_eac3_parse_header(AC3DecodeContext *s)
     ^
292. {
293.     int i, blk, ch;

libavcodec/eac3dec.c:291:1: Parameter `s->num_blocks`
  289. }
  290. 
  291. int ff_eac3_parse_header(AC3DecodeContext *s)
       ^
  292. {
  293.     int i, blk, ch;

libavcodec/eac3dec.c:291:1: <Length trace>
289. }
290. 
291. int ff_eac3_parse_header(AC3DecodeContext *s)
     ^
292. {
293.     int i, blk, ch;

libavcodec/eac3dec.c:291:1: Parameter `s->cpl_in_use[*]`
  289. }
  290. 
  291. int ff_eac3_parse_header(AC3DecodeContext *s)
       ^
  292. {
  293.     int i, blk, ch;

libavcodec/eac3dec.c:502:38: Array access: Offset: [-1, +oo] Size: 6 by call to `ff_eac3_parse_header` 
  500.                 s->cpl_in_use[blk] = get_bits1(gbc);
  501.             } else {
  502.                 s->cpl_in_use[blk] = s->cpl_in_use[blk-1];
                                            ^
  503.             }
  504.             num_cpl_blocks += s->cpl_in_use[blk];

int ff_eac3_parse_header(AC3DecodeContext *s)
{
    int i, blk, ch;
    int ac3_exponent_strategy, parse_aht_info, parse_spx_atten_data;
    int parse_transient_proc_info;
    int num_cpl_blocks;
    GetBitContext *gbc = &s->gbc;
    if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
        av_log_missing_feature(s->avctx, "Dependent substream decoding", 1);
        return AAC_AC3_PARSE_ERROR_FRAME_TYPE;
    } else if (s->frame_type == EAC3_FRAME_TYPE_RESERVED) {
        av_log(s->avctx, AV_LOG_ERROR, "Reserved frame type\n");
        return AAC_AC3_PARSE_ERROR_FRAME_TYPE;
    }
    if (s->substreamid) {
        av_log_missing_feature(s->avctx, "Additional substreams", 1);
        return AAC_AC3_PARSE_ERROR_FRAME_TYPE;
    }
    if (s->bit_alloc_params.sr_code == EAC3_SR_CODE_REDUCED) {
        av_log_missing_feature(s->avctx, "Reduced sampling rates", 1);
        return -1;
    }
    skip_bits(gbc, 5);
    for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {
        skip_bits(gbc, 5);
        if (get_bits1(gbc)) {
            skip_bits(gbc, 8);
        }
    }
    if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
        if (get_bits1(gbc)) {
            skip_bits(gbc, 16);
        }
    }
    if (get_bits1(gbc)) {
        if (s->channel_mode > AC3_CHMODE_STEREO) {
            skip_bits(gbc, 2);
            if (s->channel_mode & 1) {
                skip_bits(gbc, 3);
                s->center_mix_level = get_bits(gbc, 3);
            }
            if (s->channel_mode & 4) {
                skip_bits(gbc, 3);
                s->surround_mix_level = get_bits(gbc, 3);
            }
        }
        if (s->lfe_on && get_bits1(gbc)) {
            skip_bits(gbc, 5);
        }
        if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT) {
            for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {
                if (get_bits1(gbc)) {
                    skip_bits(gbc, 6);
                }
            }
            if (get_bits1(gbc)) {
                skip_bits(gbc, 6);
            }
            switch(get_bits(gbc, 2)) {
                case 1: skip_bits(gbc, 5);  break;
                case 2: skip_bits(gbc, 12); break;
                case 3: {
                    int mix_data_size = (get_bits(gbc, 5) + 2) << 3;
                    skip_bits_long(gbc, mix_data_size);
                    break;
                }
            }
            if (s->channel_mode < AC3_CHMODE_STEREO) {
                for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {
                    if (get_bits1(gbc)) {
                        skip_bits(gbc, 8);
                        skip_bits(gbc, 6);
                    }
                }
            }
            if (get_bits1(gbc)) {
                for (blk = 0; blk < s->num_blocks; blk++) {
                    if (s->num_blocks == 1 || get_bits1(gbc)) {
                        skip_bits(gbc, 5);
                    }
                }
            }
        }
    }
    if (get_bits1(gbc)) {
        s->bitstream_mode = get_bits(gbc, 3);
        skip_bits(gbc, 2);
        if (s->channel_mode == AC3_CHMODE_STEREO) {
            skip_bits(gbc, 4);
        }
        if (s->channel_mode >= AC3_CHMODE_2F2R) {
            skip_bits(gbc, 2);
        }
        for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {
            if (get_bits1(gbc)) {
                skip_bits(gbc, 8);
            }
        }
        if (s->bit_alloc_params.sr_code != EAC3_SR_CODE_REDUCED) {
            skip_bits1(gbc);
        }
    }
    if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT && s->num_blocks != 6) {
        skip_bits1(gbc);
    }
    if (s->frame_type == EAC3_FRAME_TYPE_AC3_CONVERT &&
            (s->num_blocks == 6 || get_bits1(gbc))) {
        skip_bits(gbc, 6);
    }
    if (get_bits1(gbc)) {
        int addbsil = get_bits(gbc, 6);
        for (i = 0; i < addbsil + 1; i++) {
            skip_bits(gbc, 8);
        }
    }
    if (s->num_blocks == 6) {
        ac3_exponent_strategy = get_bits1(gbc);
        parse_aht_info        = get_bits1(gbc);
    } else {
        ac3_exponent_strategy = 1;
        parse_aht_info = 0;
    }
    s->snr_offset_strategy    = get_bits(gbc, 2);
    parse_transient_proc_info = get_bits1(gbc);
    s->block_switch_syntax = get_bits1(gbc);
    if (!s->block_switch_syntax)
        memset(s->block_switch, 0, sizeof(s->block_switch));
    s->dither_flag_syntax = get_bits1(gbc);
    if (!s->dither_flag_syntax) {
        for (ch = 1; ch <= s->fbw_channels; ch++)
            s->dither_flag[ch] = 1;
    }
    s->dither_flag[CPL_CH] = s->dither_flag[s->lfe_ch] = 0;
    s->bit_allocation_syntax = get_bits1(gbc);
    if (!s->bit_allocation_syntax) {
        s->bit_alloc_params.slow_decay = ff_ac3_slow_decay_tab[2];
        s->bit_alloc_params.fast_decay = ff_ac3_fast_decay_tab[1];
        s->bit_alloc_params.slow_gain  = ff_ac3_slow_gain_tab [1];
        s->bit_alloc_params.db_per_bit = ff_ac3_db_per_bit_tab[2];
        s->bit_alloc_params.floor      = ff_ac3_floor_tab     [7];
    }
    s->fast_gain_syntax  = get_bits1(gbc);
    s->dba_syntax        = get_bits1(gbc);
    s->skip_syntax       = get_bits1(gbc);
    parse_spx_atten_data = get_bits1(gbc);
    num_cpl_blocks = 0;
    if (s->channel_mode > 1) {
        for (blk = 0; blk < s->num_blocks; blk++) {
            s->cpl_strategy_exists[blk] = (!blk || get_bits1(gbc));
            if (s->cpl_strategy_exists[blk]) {
                s->cpl_in_use[blk] = get_bits1(gbc);
            } else {
                s->cpl_in_use[blk] = s->cpl_in_use[blk-1];
            }
            num_cpl_blocks += s->cpl_in_use[blk];
        }
    } else {
        memset(s->cpl_in_use, 0, sizeof(s->cpl_in_use));
    }
    if (ac3_exponent_strategy) {
        for (blk = 0; blk < s->num_blocks; blk++) {
            for (ch = !s->cpl_in_use[blk]; ch <= s->fbw_channels; ch++) {
                s->exp_strategy[blk][ch] = get_bits(gbc, 2);
            }
        }
    } else {
        for (ch = !((s->channel_mode > 1) && num_cpl_blocks); ch <= s->fbw_channels; ch++) {
            int frmchexpstr = get_bits(gbc, 5);
            for (blk = 0; blk < 6; blk++) {
                s->exp_strategy[blk][ch] = ff_eac3_frm_expstr[frmchexpstr][blk];
            }
        }
    }
    if (s->lfe_on) {
        for (blk = 0; blk < s->num_blocks; blk++) {
            s->exp_strategy[blk][s->lfe_ch] = get_bits1(gbc);
        }
    }
    if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT &&
            (s->num_blocks == 6 || get_bits1(gbc))) {
        skip_bits(gbc, 5 * s->fbw_channels);
    }
    if (parse_aht_info) {
        s->channel_uses_aht[CPL_CH]=0;
        for (ch = (num_cpl_blocks != 6); ch <= s->channels; ch++) {
            int use_aht = 1;
            for (blk = 1; blk < 6; blk++) {
                if ((s->exp_strategy[blk][ch] != EXP_REUSE) ||
                        (!ch && s->cpl_strategy_exists[blk])) {
                    use_aht = 0;
                    break;
                }
            }
            s->channel_uses_aht[ch] = use_aht && get_bits1(gbc);
        }
    } else {
        memset(s->channel_uses_aht, 0, sizeof(s->channel_uses_aht));
    }
    if (!s->snr_offset_strategy) {
        int csnroffst = (get_bits(gbc, 6) - 15) << 4;
        int snroffst = (csnroffst + get_bits(gbc, 4)) << 2;
        for (ch = 0; ch <= s->channels; ch++)
            s->snr_offset[ch] = snroffst;
    }
    if (parse_transient_proc_info) {
        for (ch = 1; ch <= s->fbw_channels; ch++) {
            if (get_bits1(gbc)) {
                skip_bits(gbc, 10);
                skip_bits(gbc, 8);
            }
        }
    }
    for (ch = 1; ch <= s->fbw_channels; ch++) {
        if (parse_spx_atten_data && get_bits1(gbc)) {
            s->spx_atten_code[ch] = get_bits(gbc, 5);
        } else {
            s->spx_atten_code[ch] = -1;
        }
    }
    if (s->num_blocks > 1 && get_bits1(gbc)) {
        int block_start_bits = (s->num_blocks-1) * (4 + av_log2(s->frame_size-2));
        skip_bits_long(gbc, block_start_bits);
        av_log_missing_feature(s->avctx, "Block start info", 1);
    }
    for (ch = 1; ch <= s->fbw_channels; ch++) {
        s->first_spx_coords[ch] = 1;
        s->first_cpl_coords[ch] = 1;
    }
    s->first_cpl_leak = 1;
    return 0;
}
['static int parse_frame_header(AC3DecodeContext *s)\n{\n    AC3HeaderInfo hdr;\n    int err;\n    err = avpriv_ac3_parse_header(&s->gbc, &hdr);\n    if(err)\n        return err;\n    s->bit_alloc_params.sr_code     = hdr.sr_code;\n    s->bitstream_mode               = hdr.bitstream_mode;\n    s->channel_mode                 = hdr.channel_mode;\n    s->channel_layout               = hdr.channel_layout;\n    s->lfe_on                       = hdr.lfe_on;\n    s->bit_alloc_params.sr_shift    = hdr.sr_shift;\n    s->sample_rate                  = hdr.sample_rate;\n    s->bit_rate                     = hdr.bit_rate;\n    s->channels                     = hdr.channels;\n    s->fbw_channels                 = s->channels - s->lfe_on;\n    s->lfe_ch                       = s->fbw_channels + 1;\n    s->frame_size                   = hdr.frame_size;\n    s->center_mix_level             = hdr.center_mix_level;\n    s->surround_mix_level           = hdr.surround_mix_level;\n    s->num_blocks                   = hdr.num_blocks;\n    s->frame_type                   = hdr.frame_type;\n    s->substreamid                  = hdr.substreamid;\n    if(s->lfe_on) {\n        s->start_freq[s->lfe_ch] = 0;\n        s->end_freq[s->lfe_ch] = 7;\n        s->num_exp_groups[s->lfe_ch] = 2;\n        s->channel_in_cpl[s->lfe_ch] = 0;\n    }\n    if (hdr.bitstream_id <= 10) {\n        s->eac3                  = 0;\n        s->snr_offset_strategy   = 2;\n        s->block_switch_syntax   = 1;\n        s->dither_flag_syntax    = 1;\n        s->bit_allocation_syntax = 1;\n        s->fast_gain_syntax      = 0;\n        s->first_cpl_leak        = 0;\n        s->dba_syntax            = 1;\n        s->skip_syntax           = 1;\n        memset(s->channel_uses_aht, 0, sizeof(s->channel_uses_aht));\n        return ac3_parse_header(s);\n    } else if (CONFIG_EAC3_DECODER) {\n        s->eac3 = 1;\n        return ff_eac3_parse_header(s);\n    } else {\n        av_log(s->avctx, AV_LOG_ERROR, "E-AC-3 support not compiled in\\n");\n        return -1;\n    }\n}', 'int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr)\n{\n    int frame_size_code;\n    memset(hdr, 0, sizeof(*hdr));\n    hdr->sync_word = get_bits(gbc, 16);\n    if(hdr->sync_word != 0x0B77)\n        return AAC_AC3_PARSE_ERROR_SYNC;\n    hdr->bitstream_id = show_bits_long(gbc, 29) & 0x1F;\n    if(hdr->bitstream_id > 16)\n        return AAC_AC3_PARSE_ERROR_BSID;\n    hdr->num_blocks = 6;\n    hdr->center_mix_level   = 1;\n    hdr->surround_mix_level = 1;\n    if(hdr->bitstream_id <= 10) {\n        hdr->crc1 = get_bits(gbc, 16);\n        hdr->sr_code = get_bits(gbc, 2);\n        if(hdr->sr_code == 3)\n            return AAC_AC3_PARSE_ERROR_SAMPLE_RATE;\n        frame_size_code = get_bits(gbc, 6);\n        if(frame_size_code > 37)\n            return AAC_AC3_PARSE_ERROR_FRAME_SIZE;\n        skip_bits(gbc, 5);\n        hdr->bitstream_mode = get_bits(gbc, 3);\n        hdr->channel_mode = get_bits(gbc, 3);\n        if(hdr->channel_mode == AC3_CHMODE_STEREO) {\n            skip_bits(gbc, 2);\n        } else {\n            if((hdr->channel_mode & 1) && hdr->channel_mode != AC3_CHMODE_MONO)\n                hdr->center_mix_level = get_bits(gbc, 2);\n            if(hdr->channel_mode & 4)\n                hdr->surround_mix_level = get_bits(gbc, 2);\n        }\n        hdr->lfe_on = get_bits1(gbc);\n        hdr->sr_shift = FFMAX(hdr->bitstream_id, 8) - 8;\n        hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->sr_code] >> hdr->sr_shift;\n        hdr->bit_rate = (ff_ac3_bitrate_tab[frame_size_code>>1] * 1000) >> hdr->sr_shift;\n        hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;\n        hdr->frame_size = ff_ac3_frame_size_tab[frame_size_code][hdr->sr_code] * 2;\n        hdr->frame_type = EAC3_FRAME_TYPE_AC3_CONVERT;\n        hdr->substreamid = 0;\n    } else {\n        hdr->crc1 = 0;\n        hdr->frame_type = get_bits(gbc, 2);\n        if(hdr->frame_type == EAC3_FRAME_TYPE_RESERVED)\n            return AAC_AC3_PARSE_ERROR_FRAME_TYPE;\n        hdr->substreamid = get_bits(gbc, 3);\n        hdr->frame_size = (get_bits(gbc, 11) + 1) << 1;\n        if(hdr->frame_size < AC3_HEADER_SIZE)\n            return AAC_AC3_PARSE_ERROR_FRAME_SIZE;\n        hdr->sr_code = get_bits(gbc, 2);\n        if (hdr->sr_code == 3) {\n            int sr_code2 = get_bits(gbc, 2);\n            if(sr_code2 == 3)\n                return AAC_AC3_PARSE_ERROR_SAMPLE_RATE;\n            hdr->sample_rate = ff_ac3_sample_rate_tab[sr_code2] / 2;\n            hdr->sr_shift = 1;\n        } else {\n            hdr->num_blocks = eac3_blocks[get_bits(gbc, 2)];\n            hdr->sample_rate = ff_ac3_sample_rate_tab[hdr->sr_code];\n            hdr->sr_shift = 0;\n        }\n        hdr->channel_mode = get_bits(gbc, 3);\n        hdr->lfe_on = get_bits1(gbc);\n        hdr->bit_rate = (uint32_t)(8.0 * hdr->frame_size * hdr->sample_rate /\n                        (hdr->num_blocks * 256.0));\n        hdr->channels = ff_ac3_channels_tab[hdr->channel_mode] + hdr->lfe_on;\n    }\n    hdr->channel_layout = ff_ac3_channel_layout_tab[hdr->channel_mode];\n    if (hdr->lfe_on)\n        hdr->channel_layout |= AV_CH_LOW_FREQUENCY;\n    return 0;\n}', 'int ff_eac3_parse_header(AC3DecodeContext *s)\n{\n    int i, blk, ch;\n    int ac3_exponent_strategy, parse_aht_info, parse_spx_atten_data;\n    int parse_transient_proc_info;\n    int num_cpl_blocks;\n    GetBitContext *gbc = &s->gbc;\n    if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {\n        av_log_missing_feature(s->avctx, "Dependent substream decoding", 1);\n        return AAC_AC3_PARSE_ERROR_FRAME_TYPE;\n    } else if (s->frame_type == EAC3_FRAME_TYPE_RESERVED) {\n        av_log(s->avctx, AV_LOG_ERROR, "Reserved frame type\\n");\n        return AAC_AC3_PARSE_ERROR_FRAME_TYPE;\n    }\n    if (s->substreamid) {\n        av_log_missing_feature(s->avctx, "Additional substreams", 1);\n        return AAC_AC3_PARSE_ERROR_FRAME_TYPE;\n    }\n    if (s->bit_alloc_params.sr_code == EAC3_SR_CODE_REDUCED) {\n        av_log_missing_feature(s->avctx, "Reduced sampling rates", 1);\n        return -1;\n    }\n    skip_bits(gbc, 5);\n    for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {\n        skip_bits(gbc, 5);\n        if (get_bits1(gbc)) {\n            skip_bits(gbc, 8);\n        }\n    }\n    if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {\n        if (get_bits1(gbc)) {\n            skip_bits(gbc, 16);\n        }\n    }\n    if (get_bits1(gbc)) {\n        if (s->channel_mode > AC3_CHMODE_STEREO) {\n            skip_bits(gbc, 2);\n            if (s->channel_mode & 1) {\n                skip_bits(gbc, 3);\n                s->center_mix_level = get_bits(gbc, 3);\n            }\n            if (s->channel_mode & 4) {\n                skip_bits(gbc, 3);\n                s->surround_mix_level = get_bits(gbc, 3);\n            }\n        }\n        if (s->lfe_on && get_bits1(gbc)) {\n            skip_bits(gbc, 5);\n        }\n        if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT) {\n            for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {\n                if (get_bits1(gbc)) {\n                    skip_bits(gbc, 6);\n                }\n            }\n            if (get_bits1(gbc)) {\n                skip_bits(gbc, 6);\n            }\n            switch(get_bits(gbc, 2)) {\n                case 1: skip_bits(gbc, 5);  break;\n                case 2: skip_bits(gbc, 12); break;\n                case 3: {\n                    int mix_data_size = (get_bits(gbc, 5) + 2) << 3;\n                    skip_bits_long(gbc, mix_data_size);\n                    break;\n                }\n            }\n            if (s->channel_mode < AC3_CHMODE_STEREO) {\n                for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {\n                    if (get_bits1(gbc)) {\n                        skip_bits(gbc, 8);\n                        skip_bits(gbc, 6);\n                    }\n                }\n            }\n            if (get_bits1(gbc)) {\n                for (blk = 0; blk < s->num_blocks; blk++) {\n                    if (s->num_blocks == 1 || get_bits1(gbc)) {\n                        skip_bits(gbc, 5);\n                    }\n                }\n            }\n        }\n    }\n    if (get_bits1(gbc)) {\n        s->bitstream_mode = get_bits(gbc, 3);\n        skip_bits(gbc, 2);\n        if (s->channel_mode == AC3_CHMODE_STEREO) {\n            skip_bits(gbc, 4);\n        }\n        if (s->channel_mode >= AC3_CHMODE_2F2R) {\n            skip_bits(gbc, 2);\n        }\n        for (i = 0; i < (s->channel_mode ? 1 : 2); i++) {\n            if (get_bits1(gbc)) {\n                skip_bits(gbc, 8);\n            }\n        }\n        if (s->bit_alloc_params.sr_code != EAC3_SR_CODE_REDUCED) {\n            skip_bits1(gbc);\n        }\n    }\n    if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT && s->num_blocks != 6) {\n        skip_bits1(gbc);\n    }\n    if (s->frame_type == EAC3_FRAME_TYPE_AC3_CONVERT &&\n            (s->num_blocks == 6 || get_bits1(gbc))) {\n        skip_bits(gbc, 6);\n    }\n    if (get_bits1(gbc)) {\n        int addbsil = get_bits(gbc, 6);\n        for (i = 0; i < addbsil + 1; i++) {\n            skip_bits(gbc, 8);\n        }\n    }\n    if (s->num_blocks == 6) {\n        ac3_exponent_strategy = get_bits1(gbc);\n        parse_aht_info        = get_bits1(gbc);\n    } else {\n        ac3_exponent_strategy = 1;\n        parse_aht_info = 0;\n    }\n    s->snr_offset_strategy    = get_bits(gbc, 2);\n    parse_transient_proc_info = get_bits1(gbc);\n    s->block_switch_syntax = get_bits1(gbc);\n    if (!s->block_switch_syntax)\n        memset(s->block_switch, 0, sizeof(s->block_switch));\n    s->dither_flag_syntax = get_bits1(gbc);\n    if (!s->dither_flag_syntax) {\n        for (ch = 1; ch <= s->fbw_channels; ch++)\n            s->dither_flag[ch] = 1;\n    }\n    s->dither_flag[CPL_CH] = s->dither_flag[s->lfe_ch] = 0;\n    s->bit_allocation_syntax = get_bits1(gbc);\n    if (!s->bit_allocation_syntax) {\n        s->bit_alloc_params.slow_decay = ff_ac3_slow_decay_tab[2];\n        s->bit_alloc_params.fast_decay = ff_ac3_fast_decay_tab[1];\n        s->bit_alloc_params.slow_gain  = ff_ac3_slow_gain_tab [1];\n        s->bit_alloc_params.db_per_bit = ff_ac3_db_per_bit_tab[2];\n        s->bit_alloc_params.floor      = ff_ac3_floor_tab     [7];\n    }\n    s->fast_gain_syntax  = get_bits1(gbc);\n    s->dba_syntax        = get_bits1(gbc);\n    s->skip_syntax       = get_bits1(gbc);\n    parse_spx_atten_data = get_bits1(gbc);\n    num_cpl_blocks = 0;\n    if (s->channel_mode > 1) {\n        for (blk = 0; blk < s->num_blocks; blk++) {\n            s->cpl_strategy_exists[blk] = (!blk || get_bits1(gbc));\n            if (s->cpl_strategy_exists[blk]) {\n                s->cpl_in_use[blk] = get_bits1(gbc);\n            } else {\n                s->cpl_in_use[blk] = s->cpl_in_use[blk-1];\n            }\n            num_cpl_blocks += s->cpl_in_use[blk];\n        }\n    } else {\n        memset(s->cpl_in_use, 0, sizeof(s->cpl_in_use));\n    }\n    if (ac3_exponent_strategy) {\n        for (blk = 0; blk < s->num_blocks; blk++) {\n            for (ch = !s->cpl_in_use[blk]; ch <= s->fbw_channels; ch++) {\n                s->exp_strategy[blk][ch] = get_bits(gbc, 2);\n            }\n        }\n    } else {\n        for (ch = !((s->channel_mode > 1) && num_cpl_blocks); ch <= s->fbw_channels; ch++) {\n            int frmchexpstr = get_bits(gbc, 5);\n            for (blk = 0; blk < 6; blk++) {\n                s->exp_strategy[blk][ch] = ff_eac3_frm_expstr[frmchexpstr][blk];\n            }\n        }\n    }\n    if (s->lfe_on) {\n        for (blk = 0; blk < s->num_blocks; blk++) {\n            s->exp_strategy[blk][s->lfe_ch] = get_bits1(gbc);\n        }\n    }\n    if (s->frame_type == EAC3_FRAME_TYPE_INDEPENDENT &&\n            (s->num_blocks == 6 || get_bits1(gbc))) {\n        skip_bits(gbc, 5 * s->fbw_channels);\n    }\n    if (parse_aht_info) {\n        s->channel_uses_aht[CPL_CH]=0;\n        for (ch = (num_cpl_blocks != 6); ch <= s->channels; ch++) {\n            int use_aht = 1;\n            for (blk = 1; blk < 6; blk++) {\n                if ((s->exp_strategy[blk][ch] != EXP_REUSE) ||\n                        (!ch && s->cpl_strategy_exists[blk])) {\n                    use_aht = 0;\n                    break;\n                }\n            }\n            s->channel_uses_aht[ch] = use_aht && get_bits1(gbc);\n        }\n    } else {\n        memset(s->channel_uses_aht, 0, sizeof(s->channel_uses_aht));\n    }\n    if (!s->snr_offset_strategy) {\n        int csnroffst = (get_bits(gbc, 6) - 15) << 4;\n        int snroffst = (csnroffst + get_bits(gbc, 4)) << 2;\n        for (ch = 0; ch <= s->channels; ch++)\n            s->snr_offset[ch] = snroffst;\n    }\n    if (parse_transient_proc_info) {\n        for (ch = 1; ch <= s->fbw_channels; ch++) {\n            if (get_bits1(gbc)) {\n                skip_bits(gbc, 10);\n                skip_bits(gbc, 8);\n            }\n        }\n    }\n    for (ch = 1; ch <= s->fbw_channels; ch++) {\n        if (parse_spx_atten_data && get_bits1(gbc)) {\n            s->spx_atten_code[ch] = get_bits(gbc, 5);\n        } else {\n            s->spx_atten_code[ch] = -1;\n        }\n    }\n    if (s->num_blocks > 1 && get_bits1(gbc)) {\n        int block_start_bits = (s->num_blocks-1) * (4 + av_log2(s->frame_size-2));\n        skip_bits_long(gbc, block_start_bits);\n        av_log_missing_feature(s->avctx, "Block start info", 1);\n    }\n    for (ch = 1; ch <= s->fbw_channels; ch++) {\n        s->first_spx_coords[ch] = 1;\n        s->first_cpl_coords[ch] = 1;\n    }\n    s->first_cpl_leak = 1;\n    return 0;\n}']