static int packet_alloc(AVBufferRef **buf, int size)

{

    int ret;

    if ((unsigned)size >= (unsigned)size + AV_INPUT_BUFFER_PADDING_SIZE)

        return AVERROR(EINVAL);



    ret = av_buffer_realloc(buf, size + AV_INPUT_BUFFER_PADDING_SIZE);

    if (ret < 0)

        return ret;



    memset((*buf)->data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);



    return 0;

}

static int packet_alloc(AVBufferRef **buf, int size)

{

    int ret;

    if ((unsigned)size >= (unsigned)size + AV_INPUT_BUFFER_PADDING_SIZE)

        return AVERROR(EINVAL);



    ret = av_buffer_realloc(buf, size + AV_INPUT_BUFFER_PADDING_SIZE);

    if (ret < 0)

        return ret;



    memset((*buf)->data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);



    return 0;

}

    if ((unsigned)size >= (unsigned)size + AV_INPUT_BUFFER_PADDING_SIZE)
static int FUNC_0(AVBufferRef **VAR_0, int VAR_1)

{

    int VAR_2;

    if ((unsigned)VAR_1 >= (unsigned)VAR_1 + AV_INPUT_BUFFER_PADDING_SIZE)

        return AVERROR(EINVAL);



    VAR_2 = av_buffer_realloc(VAR_0, VAR_1 + AV_INPUT_BUFFER_PADDING_SIZE);

    if (VAR_2 < 0)

        return VAR_2;



    memset((*VAR_0)->data + VAR_1, 0, AV_INPUT_BUFFER_PADDING_SIZE);



    return 0;

}

static int FUNC_0(AVBufferRef **VAR_0, int VAR_1)
{ int VAR_2; if ((unsigned)VAR_1 >= (unsigned)VAR_1 + AV_INPUT_BUFFER_PADDING_SIZE)
return AVERROR(EINVAL); VAR_2 = av_buffer_realloc(VAR_0, VAR_1 + AV_INPUT_BUFFER_PADDING_SIZE); if (VAR_2 < 0)
return VAR_2; memset((*VAR_0)->data + VAR_1, 0, AV_INPUT_BUFFER_PADDING_SIZE); return 0; }