static int get_cod(J2kDecoderContext *s, J2kCodingStyle *c, uint8_t *properties)

{

    J2kCodingStyle tmp;

    int compno;



    if (s->buf_end - s->buf < 5)

        return AVERROR(EINVAL);



    tmp.log2_prec_width  =

    tmp.log2_prec_height = 15;



    tmp.csty = bytestream_get_byte(&s->buf);



    if (bytestream_get_byte(&s->buf)){ // progression level

        av_log(s->avctx, AV_LOG_ERROR, "only LRCP progression supported\n");

        return -1;

    }



    tmp.nlayers = bytestream_get_be16(&s->buf);

        tmp.mct = bytestream_get_byte(&s->buf); // multiple component transformation



    get_cox(s, &tmp);

    for (compno = 0; compno < s->ncomponents; compno++){

        if (!(properties[compno] & HAD_COC))

            memcpy(c + compno, &tmp, sizeof(J2kCodingStyle));

    }

    return 0;

}

static int get_cod(J2kDecoderContext *s, J2kCodingStyle *c, uint8_t *properties)

{

    J2kCodingStyle tmp;

    int compno;



    if (s->buf_end - s->buf < 5)

        return AVERROR(EINVAL);



    tmp.log2_prec_width  =

    tmp.log2_prec_height = 15;



    tmp.csty = bytestream_get_byte(&s->buf);



    if (bytestream_get_byte(&s->buf)){ 

        av_log(s->avctx, AV_LOG_ERROR, "only LRCP progression supported\n");

        return -1;

    }



    tmp.nlayers = bytestream_get_be16(&s->buf);

        tmp.mct = bytestream_get_byte(&s->buf); 



    get_cox(s, &tmp);

    for (compno = 0; compno < s->ncomponents; compno++){

        if (!(properties[compno] & HAD_COC))

            memcpy(c + compno, &tmp, sizeof(J2kCodingStyle));

    }

    return 0;

}

        return AVERROR(EINVAL);     if (s->buf_end - s->buf < 5)     if (s->buf_end - s->buf < 5)     tmp.csty = bytestream_get_byte(&s->buf);     tmp.nlayers = bytestream_get_be16(&s->buf);
static int FUNC_0(J2kDecoderContext *VAR_0, J2kCodingStyle *VAR_1, uint8_t *VAR_2)

{

    J2kCodingStyle tmp;

    int VAR_3;



    if (VAR_0->buf_end - VAR_0->buf < 5)

        return AVERROR(EINVAL);



    tmp.log2_prec_width  =

    tmp.log2_prec_height = 15;



    tmp.csty = bytestream_get_byte(&VAR_0->buf);



    if (bytestream_get_byte(&VAR_0->buf)){ 

        av_log(VAR_0->avctx, AV_LOG_ERROR, "only LRCP progression supported\n");

        return -1;

    }



    tmp.nlayers = bytestream_get_be16(&VAR_0->buf);

        tmp.mct = bytestream_get_byte(&VAR_0->buf); 



    get_cox(VAR_0, &tmp);

    for (VAR_3 = 0; VAR_3 < VAR_0->ncomponents; VAR_3++){

        if (!(VAR_2[VAR_3] & HAD_COC))

            memcpy(VAR_1 + VAR_3, &tmp, sizeof(J2kCodingStyle));

    }

    return 0;

}

static int FUNC_0(J2kDecoderContext *VAR_0, J2kCodingStyle *VAR_1, uint8_t *VAR_2)
{ J2kCodingStyle tmp; int VAR_3; if (VAR_0->buf_end - VAR_0->buf < 5)
return AVERROR(EINVAL); tmp.log2_prec_width  =
tmp.log2_prec_height = 15; tmp.csty = bytestream_get_byte(&VAR_0->buf); if (bytestream_get_byte(&VAR_0->buf)){ av_log(VAR_0->avctx, AV_LOG_ERROR, "only LRCP progression supported\n"); return -1; } tmp.nlayers = bytestream_get_be16(&VAR_0->buf); tmp.mct = bytestream_get_byte(&VAR_0->buf); get_cox(VAR_0, &tmp); for (VAR_3 = 0; VAR_3 < VAR_0->ncomponents; VAR_3++){ if (!(VAR_2[VAR_3] & HAD_COC))
memcpy(VAR_1 + VAR_3, &tmp, sizeof(J2kCodingStyle)); } return 0; }