static int decode_band_types(AACContext *ac, enum BandType band_type[120],

                             int band_type_run_end[120], GetBitContext *gb,

                             IndividualChannelStream *ics)

{

    int g, idx = 0;

    const int bits = (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) ? 3 : 5;

    for (g = 0; g < ics->num_window_groups; g++) {

        int k = 0;

        while (k < ics->max_sfb) {

            uint8_t sect_end = k;

            int sect_len_incr;

            int sect_band_type = get_bits(gb, 4);

            if (sect_band_type == 12) {

                av_log(ac->avctx, AV_LOG_ERROR, "invalid band type\n");

                return -1;

            }

            do {

                sect_len_incr = get_bits(gb, bits);

                sect_end += sect_len_incr;

                if (get_bits_left(gb) < 0) {

                    av_log(ac->avctx, AV_LOG_ERROR, overread_err);

                    return -1;

                }

                if (sect_end > ics->max_sfb) {

                    av_log(ac->avctx, AV_LOG_ERROR,

                           "Number of bands (%d) exceeds limit (%d).\n",

                           sect_end, ics->max_sfb);

                    return -1;

                }

            } while (sect_len_incr == (1 << bits) - 1);

            for (; k < sect_end; k++) {

                band_type        [idx]   = sect_band_type;

                band_type_run_end[idx++] = sect_end;

            }

        }

    }

    return 0;

}

static int decode_band_types(AACContext *ac, enum BandType band_type[120],

                             int band_type_run_end[120], GetBitContext *gb,

                             IndividualChannelStream *ics)

{

    int g, idx = 0;

    const int bits = (ics->window_sequence[0] == EIGHT_SHORT_SEQUENCE) ? 3 : 5;

    for (g = 0; g < ics->num_window_groups; g++) {

        int k = 0;

        while (k < ics->max_sfb) {

            uint8_t sect_end = k;

            int sect_len_incr;

            int sect_band_type = get_bits(gb, 4);

            if (sect_band_type == 12) {

                av_log(ac->avctx, AV_LOG_ERROR, "invalid band type\n");

                return -1;

            }

            do {

                sect_len_incr = get_bits(gb, bits);

                sect_end += sect_len_incr;

                if (get_bits_left(gb) < 0) {

                    av_log(ac->avctx, AV_LOG_ERROR, overread_err);

                    return -1;

                }

                if (sect_end > ics->max_sfb) {

                    av_log(ac->avctx, AV_LOG_ERROR,

                           "Number of bands (%d) exceeds limit (%d).\n",

                           sect_end, ics->max_sfb);

                    return -1;

                }

            } while (sect_len_incr == (1 << bits) - 1);

            for (; k < sect_end; k++) {

                band_type        [idx]   = sect_band_type;

                band_type_run_end[idx++] = sect_end;

            }

        }

    }

    return 0;

}

                    av_log(ac->avctx, AV_LOG_ERROR, overread_err);
static int FUNC_0(AACContext *VAR_0, enum BandType VAR_1[120],

                             int VAR_2[120], GetBitContext *VAR_3,

                             IndividualChannelStream *VAR_4)

{

    int VAR_5, VAR_6 = 0;

    const int VAR_7 = (VAR_4->window_sequence[0] == EIGHT_SHORT_SEQUENCE) ? 3 : 5;

    for (VAR_5 = 0; VAR_5 < VAR_4->num_window_groups; VAR_5++) {

        int k = 0;

        while (k < VAR_4->max_sfb) {

            uint8_t sect_end = k;

            int sect_len_incr;

            int sect_band_type = get_bits(VAR_3, 4);

            if (sect_band_type == 12) {

                av_log(VAR_0->avctx, AV_LOG_ERROR, "invalid band type\n");

                return -1;

            }

            do {

                sect_len_incr = get_bits(VAR_3, VAR_7);

                sect_end += sect_len_incr;

                if (get_bits_left(VAR_3) < 0) {

                    av_log(VAR_0->avctx, AV_LOG_ERROR, overread_err);

                    return -1;

                }

                if (sect_end > VAR_4->max_sfb) {

                    av_log(VAR_0->avctx, AV_LOG_ERROR,

                           "Number of bands (%d) exceeds limit (%d).\n",

                           sect_end, VAR_4->max_sfb);

                    return -1;

                }

            } while (sect_len_incr == (1 << VAR_7) - 1);

            for (; k < sect_end; k++) {

                VAR_1        [VAR_6]   = sect_band_type;

                VAR_2[VAR_6++] = sect_end;

            }

        }

    }

    return 0;

}

static int FUNC_0(AACContext *VAR_0, enum BandType VAR_1[120],
int VAR_2[120], GetBitContext *VAR_3,
IndividualChannelStream *VAR_4)
{ int VAR_5, VAR_6 = 0; const int VAR_7 = (VAR_4->window_sequence[0] == EIGHT_SHORT_SEQUENCE) ? 3 : 5; for (VAR_5 = 0; VAR_5 < VAR_4->num_window_groups; VAR_5++) { int k = 0; while (k < VAR_4->max_sfb) { uint8_t sect_end = k; int sect_len_incr; int sect_band_type = get_bits(VAR_3, 4); if (sect_band_type == 12) { av_log(VAR_0->avctx, AV_LOG_ERROR, "invalid band type\n"); return -1; } do { sect_len_incr = get_bits(VAR_3, VAR_7); sect_end += sect_len_incr; if (get_bits_left(VAR_3) < 0) { av_log(VAR_0->avctx, AV_LOG_ERROR, overread_err); return -1; } if (sect_end > VAR_4->max_sfb) { av_log(VAR_0->avctx, AV_LOG_ERROR,
"Number of bands (%d) exceeds limit (%d).\n",
sect_end, VAR_4->max_sfb); return -1; } } while (sect_len_incr == (1 << VAR_7) - 1); for (; k < sect_end; k++) { VAR_1        [VAR_6]   = sect_band_type; VAR_2[VAR_6++] = sect_end; } } } return 0; }