int ff_cmap_read_palette(AVCodecContext *avctx, uint32_t *pal)

{

    int count, i;



    if (avctx->bits_per_coded_sample > 8) {

        av_log(avctx, AV_LOG_ERROR, "bit_per_coded_sample > 8 not supported\n");

        return AVERROR_INVALIDDATA;

    }



    count = 1 << avctx->bits_per_coded_sample;

    if (avctx->extradata_size < count * 3) {

        av_log(avctx, AV_LOG_ERROR, "palette data underflow\n");

        return AVERROR_INVALIDDATA;

    }

    for (i=0; i < count; i++) {

        pal[i] = 0xFF000000 | AV_RB24( avctx->extradata + i*3 );

    }

    return 0;

}

int ff_cmap_read_palette(AVCodecContext *avctx, uint32_t *pal)

{

    int count, i;



    if (avctx->bits_per_coded_sample > 8) {

        av_log(avctx, AV_LOG_ERROR, "bit_per_coded_sample > 8 not supported\n");

        return AVERROR_INVALIDDATA;

    }



    count = 1 << avctx->bits_per_coded_sample;

    if (avctx->extradata_size < count * 3) {

        av_log(avctx, AV_LOG_ERROR, "palette data underflow\n");

        return AVERROR_INVALIDDATA;

    }

    for (i=0; i < count; i++) {

        pal[i] = 0xFF000000 | AV_RB24( avctx->extradata + i*3 );

    }

    return 0;

}

    if (avctx->extradata_size < count * 3) {         av_log(avctx, AV_LOG_ERROR, "palette data underflow\n");         return AVERROR_INVALIDDATA;
int FUNC_0(AVCodecContext *VAR_0, uint32_t *VAR_1)

{

    int VAR_2, VAR_3;



    if (VAR_0->bits_per_coded_sample > 8) {

        av_log(VAR_0, AV_LOG_ERROR, "bit_per_coded_sample > 8 not supported\n");

        return AVERROR_INVALIDDATA;

    }



    VAR_2 = 1 << VAR_0->bits_per_coded_sample;

    if (VAR_0->extradata_size < VAR_2 * 3) {

        av_log(VAR_0, AV_LOG_ERROR, "palette data underflow\n");

        return AVERROR_INVALIDDATA;

    }

    for (VAR_3=0; VAR_3 < VAR_2; VAR_3++) {

        VAR_1[VAR_3] = 0xFF000000 | AV_RB24( VAR_0->extradata + VAR_3*3 );

    }

    return 0;

}

int FUNC_0(AVCodecContext *VAR_0, uint32_t *VAR_1)
{ int VAR_2, VAR_3; if (VAR_0->bits_per_coded_sample > 8) { av_log(VAR_0, AV_LOG_ERROR, "bit_per_coded_sample > 8 not supported\n"); return AVERROR_INVALIDDATA; } VAR_2 = 1 << VAR_0->bits_per_coded_sample; if (VAR_0->extradata_size < VAR_2 * 3) { av_log(VAR_0, AV_LOG_ERROR, "palette data underflow\n"); return AVERROR_INVALIDDATA; } for (VAR_3=0; VAR_3 < VAR_2; VAR_3++) { VAR_1[VAR_3] = 0xFF000000 | AV_RB24( VAR_0->extradata + VAR_3*3 ); } return 0; }