static int setup_partitions(VP8Context *s, const uint8_t *buf, int buf_size)

{

    const uint8_t *sizes = buf;

    int i;



    s->num_coeff_partitions = 1 << vp8_rac_get_uint(&s->c, 2);



    buf      += 3 * (s->num_coeff_partitions - 1);

    buf_size -= 3 * (s->num_coeff_partitions - 1);

    if (buf_size < 0)

        return -1;



    for (i = 0; i < s->num_coeff_partitions - 1; i++) {

        int size = AV_RL24(sizes + 3 * i);

        if (buf_size - size < 0)

            return -1;



        ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, size);

        buf      += size;

        buf_size -= size;

    }

    ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, buf_size);



    return 0;

}

static int setup_partitions(VP8Context *s, const uint8_t *buf, int buf_size)

{

    const uint8_t *sizes = buf;

    int i;



    s->num_coeff_partitions = 1 << vp8_rac_get_uint(&s->c, 2);



    buf      += 3 * (s->num_coeff_partitions - 1);

    buf_size -= 3 * (s->num_coeff_partitions - 1);

    if (buf_size < 0)

        return -1;



    for (i = 0; i < s->num_coeff_partitions - 1; i++) {

        int size = AV_RL24(sizes + 3 * i);

        if (buf_size - size < 0)

            return -1;



        ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, size);

        buf      += size;

        buf_size -= size;

    }

    ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, buf_size);



    return 0;

}

        ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, size);     ff_vp56_init_range_decoder(&s->coeff_partition[i], buf, buf_size);     return 0;
static int FUNC_0(VP8Context *VAR_0, const uint8_t *VAR_1, int VAR_2)

{

    const uint8_t *VAR_3 = VAR_1;

    int VAR_4;



    VAR_0->num_coeff_partitions = 1 << vp8_rac_get_uint(&VAR_0->c, 2);



    VAR_1      += 3 * (VAR_0->num_coeff_partitions - 1);

    VAR_2 -= 3 * (VAR_0->num_coeff_partitions - 1);

    if (VAR_2 < 0)

        return -1;



    for (VAR_4 = 0; VAR_4 < VAR_0->num_coeff_partitions - 1; VAR_4++) {

        int size = AV_RL24(VAR_3 + 3 * VAR_4);

        if (VAR_2 - size < 0)

            return -1;



        ff_vp56_init_range_decoder(&VAR_0->coeff_partition[VAR_4], VAR_1, size);

        VAR_1      += size;

        VAR_2 -= size;

    }

    ff_vp56_init_range_decoder(&VAR_0->coeff_partition[VAR_4], VAR_1, VAR_2);



    return 0;

}

static int FUNC_0(VP8Context *VAR_0, const uint8_t *VAR_1, int VAR_2)
{ const uint8_t *VAR_3 = VAR_1; int VAR_4; VAR_0->num_coeff_partitions = 1 << vp8_rac_get_uint(&VAR_0->c, 2); VAR_1      += 3 * (VAR_0->num_coeff_partitions - 1); VAR_2 -= 3 * (VAR_0->num_coeff_partitions - 1); if (VAR_2 < 0)
return -1; for (VAR_4 = 0; VAR_4 < VAR_0->num_coeff_partitions - 1; VAR_4++) { int size = AV_RL24(VAR_3 + 3 * VAR_4); if (VAR_2 - size < 0)
return -1; ff_vp56_init_range_decoder(&VAR_0->coeff_partition[VAR_4], VAR_1, size); VAR_1      += size; VAR_2 -= size; } ff_vp56_init_range_decoder(&VAR_0->coeff_partition[VAR_4], VAR_1, VAR_2); return 0; }