static void sub2video_copy_rect(uint8_t *dst, int dst_linesize, int w, int h,

                                AVSubtitleRect *r)

{

    uint32_t *pal, *dst2;

    uint8_t *src, *src2;

    int x, y;



    if (r->type != SUBTITLE_BITMAP) {

        av_log(NULL, AV_LOG_WARNING, "sub2video: non-bitmap subtitle\n");

        return;

    }

    if (r->x < 0 || r->x + r->w > w || r->y < 0 || r->y + r->h > h) {

        av_log(NULL, AV_LOG_WARNING, "sub2video: rectangle overflowing\n");

        return;

    }



    dst += r->y * dst_linesize + r->x * 4;

    src = r->pict.data[0];

    pal = (uint32_t *)r->pict.data[1];

    for (y = 0; y < r->h; y++) {

        dst2 = (uint32_t *)dst;

        src2 = src;

        for (x = 0; x < r->w; x++)

            *(dst2++) = pal[*(src2++)];

        dst += dst_linesize;

        src += r->pict.linesize[0];

    }

}

static void sub2video_copy_rect(uint8_t *dst, int dst_linesize, int w, int h,

                                AVSubtitleRect *r)

{

    uint32_t *pal, *dst2;

    uint8_t *src, *src2;

    int x, y;



    if (r->type != SUBTITLE_BITMAP) {

        av_log(NULL, AV_LOG_WARNING, "sub2video: non-bitmap subtitle\n");

        return;

    }

    if (r->x < 0 || r->x + r->w > w || r->y < 0 || r->y + r->h > h) {

        av_log(NULL, AV_LOG_WARNING, "sub2video: rectangle overflowing\n");

        return;

    }



    dst += r->y * dst_linesize + r->x * 4;

    src = r->pict.data[0];

    pal = (uint32_t *)r->pict.data[1];

    for (y = 0; y < r->h; y++) {

        dst2 = (uint32_t *)dst;

        src2 = src;

        for (x = 0; x < r->w; x++)

            *(dst2++) = pal[*(src2++)];

        dst += dst_linesize;

        src += r->pict.linesize[0];

    }

}

        av_log(NULL, AV_LOG_WARNING, "sub2video: rectangle overflowing\n");
static void FUNC_0(uint8_t *VAR_0, int VAR_1, int VAR_2, int VAR_3,

                                AVSubtitleRect *VAR_4)

{

    uint32_t *pal, *dst2;

    uint8_t *src, *src2;

    int VAR_5, VAR_6;



    if (VAR_4->type != SUBTITLE_BITMAP) {

        av_log(NULL, AV_LOG_WARNING, "sub2video: non-bitmap subtitle\n");

        return;

    }

    if (VAR_4->VAR_5 < 0 || VAR_4->VAR_5 + VAR_4->VAR_2 > VAR_2 || VAR_4->VAR_6 < 0 || VAR_4->VAR_6 + VAR_4->VAR_3 > VAR_3) {

        av_log(NULL, AV_LOG_WARNING, "sub2video: rectangle overflowing\n");

        return;

    }



    VAR_0 += VAR_4->VAR_6 * VAR_1 + VAR_4->VAR_5 * 4;

    src = VAR_4->pict.data[0];

    pal = (uint32_t *)VAR_4->pict.data[1];

    for (VAR_6 = 0; VAR_6 < VAR_4->VAR_3; VAR_6++) {

        dst2 = (uint32_t *)VAR_0;

        src2 = src;

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

            *(dst2++) = pal[*(src2++)];

        VAR_0 += VAR_1;

        src += VAR_4->pict.linesize[0];

    }

}

static void FUNC_0(uint8_t *VAR_0, int VAR_1, int VAR_2, int VAR_3,
AVSubtitleRect *VAR_4)
{ uint32_t *pal, *dst2; uint8_t *src, *src2; int VAR_5, VAR_6; if (VAR_4->type != SUBTITLE_BITMAP) { av_log(NULL, AV_LOG_WARNING, "sub2video: non-bitmap subtitle\n"); return; } if (VAR_4->VAR_5 < 0 || VAR_4->VAR_5 + VAR_4->VAR_2 > VAR_2 || VAR_4->VAR_6 < 0 || VAR_4->VAR_6 + VAR_4->VAR_3 > VAR_3) { av_log(NULL, AV_LOG_WARNING, "sub2video: rectangle overflowing\n"); return; } VAR_0 += VAR_4->VAR_6 * VAR_1 + VAR_4->VAR_5 * 4; src = VAR_4->pict.data[0]; pal = (uint32_t *)VAR_4->pict.data[1]; for (VAR_6 = 0; VAR_6 < VAR_4->VAR_3; VAR_6++) { dst2 = (uint32_t *)VAR_0; src2 = src; for (VAR_5 = 0; VAR_5 < VAR_4->VAR_2; VAR_5++) *(dst2++) = pal[*(src2++)]; VAR_0 += VAR_1; src += VAR_4->pict.linesize[0]; } }