static int load_textfile(AVFilterContext *ctx)

{

    DrawTextContext *s = ctx->priv;

    int err;

    uint8_t *textbuf;

    size_t textbuf_size;



    if ((err = av_file_map(s->textfile, &textbuf, &textbuf_size, 0, ctx)) < 0) {

        av_log(ctx, AV_LOG_ERROR,

               "The text file '%s' could not be read or is empty\n",

               s->textfile);

        return err;

    }



    if (!(s->text = av_realloc(s->text, textbuf_size + 1)))

        return AVERROR(ENOMEM);

    memcpy(s->text, textbuf, textbuf_size);

    s->text[textbuf_size] = 0;

    av_file_unmap(textbuf, textbuf_size);



    return 0;

}

static int load_textfile(AVFilterContext *ctx)

{

    DrawTextContext *s = ctx->priv;

    int err;

    uint8_t *textbuf;

    size_t textbuf_size;



    if ((err = av_file_map(s->textfile, &textbuf, &textbuf_size, 0, ctx)) < 0) {

        av_log(ctx, AV_LOG_ERROR,

               "The text file '%s' could not be read or is empty\n",

               s->textfile);

        return err;

    }



    if (!(s->text = av_realloc(s->text, textbuf_size + 1)))

        return AVERROR(ENOMEM);

    memcpy(s->text, textbuf, textbuf_size);

    s->text[textbuf_size] = 0;

    av_file_unmap(textbuf, textbuf_size);



    return 0;

}

    if (!(s->text = av_realloc(s->text, textbuf_size + 1)))
static int FUNC_0(AVFilterContext *VAR_0)

{

    DrawTextContext *s = VAR_0->priv;

    int VAR_1;

    uint8_t *textbuf;

    size_t textbuf_size;



    if ((VAR_1 = av_file_map(s->textfile, &textbuf, &textbuf_size, 0, VAR_0)) < 0) {

        av_log(VAR_0, AV_LOG_ERROR,

               "The text file '%s' could not be read or is empty\n",

               s->textfile);

        return VAR_1;

    }



    if (!(s->text = av_realloc(s->text, textbuf_size + 1)))

        return AVERROR(ENOMEM);

    memcpy(s->text, textbuf, textbuf_size);

    s->text[textbuf_size] = 0;

    av_file_unmap(textbuf, textbuf_size);



    return 0;

}

static int FUNC_0(AVFilterContext *VAR_0)
{ DrawTextContext *s = VAR_0->priv; int VAR_1; uint8_t *textbuf; size_t textbuf_size; if ((VAR_1 = av_file_map(s->textfile, &textbuf, &textbuf_size, 0, VAR_0)) < 0) { av_log(VAR_0, AV_LOG_ERROR,
"The text file '%s' could not be read or is empty\n",
s->textfile); return VAR_1; } if (!(s->text = av_realloc(s->text, textbuf_size + 1)))
return AVERROR(ENOMEM); memcpy(s->text, textbuf, textbuf_size); s->text[textbuf_size] = 0; av_file_unmap(textbuf, textbuf_size); return 0; }