static int parse_palette(AVCodecContext *avctx, GetByteContext *gbc,

                         uint32_t *pal, int colors)

{

    int i;



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

        uint8_t r, g, b;

        unsigned int idx = bytestream2_get_be16(gbc); /* color index */

        if (idx > 255) {

            av_log(avctx, AV_LOG_WARNING,

                   "Palette index out of range: %u\n", idx);

            bytestream2_skip(gbc, 6);

            continue;

        }

        r = bytestream2_get_byte(gbc);

        bytestream2_skip(gbc, 1);

        g = bytestream2_get_byte(gbc);

        bytestream2_skip(gbc, 1);

        b = bytestream2_get_byte(gbc);

        bytestream2_skip(gbc, 1);

        pal[idx] = (r << 16) | (g << 8) | b;

    }

    return 0;

}

static int parse_palette(AVCodecContext *avctx, GetByteContext *gbc,

                         uint32_t *pal, int colors)

{

    int i;



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

        uint8_t r, g, b;

        unsigned int idx = bytestream2_get_be16(gbc); 

        if (idx > 255) {

            av_log(avctx, AV_LOG_WARNING,

                   "Palette index out of range: %u\n", idx);

            bytestream2_skip(gbc, 6);

            continue;

        }

        r = bytestream2_get_byte(gbc);

        bytestream2_skip(gbc, 1);

        g = bytestream2_get_byte(gbc);

        bytestream2_skip(gbc, 1);

        b = bytestream2_get_byte(gbc);

        bytestream2_skip(gbc, 1);

        pal[idx] = (r << 16) | (g << 8) | b;

    }

    return 0;

}

        pal[idx] = (r << 16) | (g << 8) | b;
static int FUNC_0(AVCodecContext *VAR_0, GetByteContext *VAR_1,

                         uint32_t *VAR_2, int VAR_3)

{

    int VAR_4;



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

        uint8_t r, g, b;

        unsigned int VAR_5 = bytestream2_get_be16(VAR_1); 

        if (VAR_5 > 255) {

            av_log(VAR_0, AV_LOG_WARNING,

                   "Palette index out of range: %u\n", VAR_5);

            bytestream2_skip(VAR_1, 6);

            continue;

        }

        r = bytestream2_get_byte(VAR_1);

        bytestream2_skip(VAR_1, 1);

        g = bytestream2_get_byte(VAR_1);

        bytestream2_skip(VAR_1, 1);

        b = bytestream2_get_byte(VAR_1);

        bytestream2_skip(VAR_1, 1);

        VAR_2[VAR_5] = (r << 16) | (g << 8) | b;

    }

    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0, GetByteContext *VAR_1,
uint32_t *VAR_2, int VAR_3)
{ int VAR_4; for (VAR_4 = 0; VAR_4 <= VAR_3; VAR_4++) { uint8_t r, g, b; unsigned int VAR_5 = bytestream2_get_be16(VAR_1); if (VAR_5 > 255) { av_log(VAR_0, AV_LOG_WARNING,
"Palette index out of range: %u\n", VAR_5); bytestream2_skip(VAR_1, 6); continue; } r = bytestream2_get_byte(VAR_1); bytestream2_skip(VAR_1, 1); g = bytestream2_get_byte(VAR_1); bytestream2_skip(VAR_1, 1); b = bytestream2_get_byte(VAR_1); bytestream2_skip(VAR_1, 1); VAR_2[VAR_5] = (r << 16) | (g << 8) | b; } return 0; }