static int nvdec_mpeg12_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)

{

    NVDECContext *ctx = avctx->internal->hwaccel_priv_data;

    void *tmp;



    tmp = av_fast_realloc(ctx->slice_offsets, &ctx->slice_offsets_allocated,

                          (ctx->nb_slices + 1) * sizeof(*ctx->slice_offsets));

    if (!tmp)

        return AVERROR(ENOMEM);

    ctx->slice_offsets = tmp;



    if (!ctx->bitstream)

        ctx->bitstream = (uint8_t*)buffer;



    ctx->slice_offsets[ctx->nb_slices] = buffer - ctx->bitstream;

    ctx->bitstream_len += size;

    ctx->nb_slices++;



    return 0;

}

static int nvdec_mpeg12_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)

{

    NVDECContext *ctx = avctx->internal->hwaccel_priv_data;

    void *tmp;



    tmp = av_fast_realloc(ctx->slice_offsets, &ctx->slice_offsets_allocated,

                          (ctx->nb_slices + 1) * sizeof(*ctx->slice_offsets));

    if (!tmp)

        return AVERROR(ENOMEM);

    ctx->slice_offsets = tmp;



    if (!ctx->bitstream)

        ctx->bitstream = (uint8_t*)buffer;



    ctx->slice_offsets[ctx->nb_slices] = buffer - ctx->bitstream;

    ctx->bitstream_len += size;

    ctx->nb_slices++;



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0, const uint8_t *VAR_1, uint32_t VAR_2)

{

    NVDECContext *ctx = VAR_0->internal->hwaccel_priv_data;

    void *VAR_3;



    VAR_3 = av_fast_realloc(ctx->slice_offsets, &ctx->slice_offsets_allocated,

                          (ctx->nb_slices + 1) * sizeof(*ctx->slice_offsets));

    if (!VAR_3)

        return AVERROR(ENOMEM);

    ctx->slice_offsets = VAR_3;



    if (!ctx->bitstream)

        ctx->bitstream = (uint8_t*)VAR_1;



    ctx->slice_offsets[ctx->nb_slices] = VAR_1 - ctx->bitstream;

    ctx->bitstream_len += VAR_2;

    ctx->nb_slices++;



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0, const uint8_t *VAR_1, uint32_t VAR_2)
{ NVDECContext *ctx = VAR_0->internal->hwaccel_priv_data; void *VAR_3; VAR_3 = av_fast_realloc(ctx->slice_offsets, &ctx->slice_offsets_allocated,
(ctx->nb_slices + 1) * sizeof(*ctx->slice_offsets)); if (!VAR_3)
return AVERROR(ENOMEM); ctx->slice_offsets = VAR_3; if (!ctx->bitstream)
ctx->bitstream = (uint8_t*)VAR_1; ctx->slice_offsets[ctx->nb_slices] = VAR_1 - ctx->bitstream; ctx->bitstream_len += VAR_2; ctx->nb_slices++; return 0; }