@@ -129,7 +129,7 @@ static VLC block_type_vlc[2][4];
typedef struct CFrameBuffer {
- unsigned int allocated_size;
+ size_t allocated_size;
unsigned int size;
int id;
uint8_t *data;
@@ -895,8 +895,8 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
if (data_size > UINT_MAX - cfrm->size - AV_INPUT_BUFFER_PADDING_SIZE)
return AVERROR_INVALIDDATA;
- cfrm->data = av_fast_realloc(cfrm->data, &cfrm->allocated_size,
- cfrm->size + data_size + AV_INPUT_BUFFER_PADDING_SIZE);
+ cfrm->data = av_realloc_reuse(cfrm->data, &cfrm->allocated_size,
+ cfrm->size + data_size + AV_INPUT_BUFFER_PADDING_SIZE);
// explicit check needed as memcpy below might not catch a NULL
if (!cfrm->data) {
av_log(f->avctx, AV_LOG_ERROR, "realloc failure\n");
@@ -43,7 +43,8 @@ void ff_af_queue_close(AudioFrameQueue *afq)
int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
{
- AudioFrame *new = av_fast_realloc(afq->frames, &afq->frame_alloc, sizeof(*afq->frames)*(afq->frame_count+1));
+ AudioFrame *new = av_realloc_reuse(afq->frames, &afq->frame_alloc,
+ sizeof(*afq->frames)*(afq->frame_count+1));
if(!new)
return AVERROR(ENOMEM);
afq->frames = new;
@@ -35,7 +35,7 @@ typedef struct AudioFrameQueue {
int remaining_samples;
AudioFrame *frames;
unsigned frame_count;
- unsigned frame_alloc;
+ size_t frame_alloc;
} AudioFrameQueue;
/**
@@ -70,7 +70,7 @@ int ff_av1_packet_split(AV1Packet *pkt, const uint8_t *buf, int length, void *lo
if (new_size >= INT_MAX / sizeof(*tmp))
return AVERROR(ENOMEM);
- tmp = av_fast_realloc(pkt->obus, &pkt->obus_allocated_size, new_size * sizeof(*tmp));
+ tmp = av_realloc_reuse(pkt->obus, &pkt->obus_allocated_size, new_size * sizeof(*tmp));
if (!tmp)
return AVERROR(ENOMEM);
@@ -63,7 +63,7 @@ typedef struct AV1Packet {
AV1OBU *obus;
int nb_obus;
int obus_allocated;
- unsigned obus_allocated_size;
+ size_t obus_allocated_size;
} AV1Packet;
/**
@@ -46,7 +46,7 @@ typedef struct DiracParseContext {
int sync_offset;
int header_bytes_needed;
int overread_index;
- int buffer_size;
+ size_t buffer_size;
int index;
uint8_t *buffer;
int dirac_unit_size;
@@ -156,8 +156,8 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
if (next == -1) {
/* Found a possible frame start but not a frame end */
void *new_buffer =
- av_fast_realloc(pc->buffer, &pc->buffer_size,
- pc->index + (*buf_size - pc->sync_offset));
+ av_realloc_reuse(pc->buffer, &pc->buffer_size,
+ pc->index + (*buf_size - pc->sync_offset));
if (!new_buffer)
return AVERROR(ENOMEM);
pc->buffer = new_buffer;
@@ -168,8 +168,8 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
} else {
/* Found a possible frame start and a possible frame end */
DiracParseUnit pu1, pu;
- void *new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size,
- pc->index + next);
+ void *new_buffer = av_realloc_reuse(pc->buffer, &pc->buffer_size,
+ pc->index + next);
if (!new_buffer)
return AVERROR(ENOMEM);
pc->buffer = new_buffer;
@@ -33,7 +33,7 @@
struct AV1DXVAContext {
FFDXVASharedContext shared;
- unsigned int bitstream_allocated;
+ size_t bitstream_allocated;
uint8_t *bitstream_cache;
};
@@ -321,8 +321,8 @@ static int dxva2_av1_decode_slice(AVCodecContext *avctx,
}
/* allocate an internal buffer */
- tmp = av_fast_realloc(ctx->bitstream_cache, &ctx->bitstream_allocated,
- ctx_pic->bitstream_size + size);
+ tmp = av_realloc_reuse(ctx->bitstream_cache, &ctx->bitstream_allocated,
+ ctx_pic->bitstream_size + size);
if (!tmp) {
return AVERROR(ENOMEM);
}
@@ -95,7 +95,7 @@ typedef struct FLACParseContext {
can be verified */
int end_padded; /**< specifies if fifo_buf's end is padded */
uint8_t *wrap_buf; /**< general fifo read buffer when wrapped */
- int wrap_buf_allocated_size; /**< actual allocated size of the buffer */
+ size_t wrap_buf_allocated_size;/**< actual allocated size of the buffer */
FLACFrameInfo last_fi; /**< last decoded frame header info */
int last_fi_valid; /**< set if last_fi is valid */
} FLACParseContext;
@@ -160,7 +160,7 @@ static size_t flac_fifo_space(const FifoBuffer *f)
* about a memory barrier for SMP.
*/
static uint8_t *flac_fifo_read_wrap(FLACParseContext *fpc, int offset, int len,
- uint8_t **wrap_buf, int *allocated_size)
+ uint8_t **wrap_buf, size_t *allocated_size)
{
FifoBuffer *f = &fpc->fifo_buf;
uint8_t *start = f->rptr + offset;
@@ -171,7 +171,7 @@ static uint8_t *flac_fifo_read_wrap(FLACParseContext *fpc, int offset, int len,
if (f->end - start >= len)
return start;
- tmp_buf = av_fast_realloc(*wrap_buf, allocated_size, len);
+ tmp_buf = av_realloc_reuse(*wrap_buf, allocated_size, len);
if (!tmp_buf) {
av_log(fpc->avctx, AV_LOG_ERROR,
@@ -463,7 +463,7 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
if (new_size >= INT_MAX / sizeof(*pkt->nals))
return AVERROR(ENOMEM);
- tmp = av_fast_realloc(pkt->nals, &pkt->nal_buffer_size, new_size * sizeof(*pkt->nals));
+ tmp = av_realloc_reuse(pkt->nals, &pkt->nal_buffer_size, new_size * sizeof(*pkt->nals));
if (!tmp)
return AVERROR(ENOMEM);
@@ -84,7 +84,7 @@ typedef struct H2645Packet {
H2645RBSP rbsp;
int nb_nals;
int nals_allocated;
- unsigned nal_buffer_size;
+ size_t nal_buffer_size;
} H2645Packet;
/**
@@ -70,7 +70,7 @@ typedef struct AOMEncoderContext {
struct aom_codec_ctx encoder;
struct aom_image rawimg;
struct aom_fixed_buf twopass_stats;
- unsigned twopass_stats_size;
+ size_t twopass_stats_size;
struct FrameListData *coded_frame_list;
int cpu_used;
int auto_alt_ref;
@@ -1201,10 +1201,10 @@ static int queue_frames(AVCodecContext *avctx, AVPacket *pkt_out)
case AOM_CODEC_STATS_PKT:
{
struct aom_fixed_buf *stats = &ctx->twopass_stats;
- uint8_t *tmp = av_fast_realloc(stats->buf,
- &ctx->twopass_stats_size,
- stats->sz +
- pkt->data.twopass_stats.sz);
+ uint8_t *tmp = av_realloc_reuse(stats->buf,
+ &ctx->twopass_stats_size,
+ stats->sz +
+ pkt->data.twopass_stats.sz);
if (!tmp) {
av_freep(&stats->buf);
stats->sz = 0;
@@ -45,6 +45,7 @@ typedef struct librav1eContext {
uint8_t *pass_data;
size_t pass_pos;
+ size_t pass_size_allocated;
int pass_size;
AVDictionary *rav1e_opts;
@@ -116,8 +117,8 @@ static int get_stats(AVCodecContext *avctx, int eos)
return 0;
if (!eos) {
- uint8_t *tmp = av_fast_realloc(ctx->pass_data, &ctx->pass_size,
- ctx->pass_pos + buf->len);
+ uint8_t *tmp = av_realloc_reuse(ctx->pass_data, &ctx->pass_size_allocated,
+ ctx->pass_pos + buf->len);
if (!tmp) {
rav1e_data_unref(buf);
return AVERROR(ENOMEM);
@@ -46,6 +46,7 @@
typedef struct TheoraContext {
th_enc_ctx *t_state;
uint8_t *stats;
+ size_t stats_size_allocated;
int stats_size;
int stats_offset;
int uv_hshift;
@@ -100,8 +101,8 @@ static int get_stats(AVCodecContext *avctx, int eos)
return AVERROR_EXTERNAL;
}
if (!eos) {
- void *tmp = av_fast_realloc(h->stats, &h->stats_size,
- h->stats_offset + bytes);
+ void *tmp = av_realloc_reuse(h->stats, &h->stats_size_allocated,
+ h->stats_offset + bytes);
if (!tmp)
return AVERROR(ENOMEM);
h->stats = tmp;
@@ -80,7 +80,7 @@ typedef struct VPxEncoderContext {
struct vpx_image rawimg_alpha;
uint8_t is_alpha;
struct vpx_fixed_buf twopass_stats;
- unsigned twopass_stats_size;
+ size_t twopass_stats_size;
int deadline; //i.e., RT/GOOD/BEST
uint64_t sse[4];
int have_sse; /**< true if we have pending sse[] */
@@ -1368,10 +1368,10 @@ static int queue_frames(AVCodecContext *avctx, struct vpx_codec_ctx *encoder,
uint8_t *tmp;
if (!pkt_out)
break;
- tmp = av_fast_realloc(stats->buf,
- &ctx->twopass_stats_size,
- stats->sz +
- pkt->data.twopass_stats.sz);
+ tmp = av_realloc_reuse(stats->buf,
+ &ctx->twopass_stats_size,
+ stats->sz +
+ pkt->data.twopass_stats.sz);
if (!tmp) {
av_freep(&stats->buf);
stats->sz = 0;
@@ -359,7 +359,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
if (frame) {
x264_sei_t *sei = &x4->pic.extra_sei;
- unsigned int sei_data_size = 0;
+ size_t sei_data_size = 0;
for (i = 0; i < x4->pic.img.i_plane; i++) {
x4->pic.img.plane[i] = frame->data[i];
@@ -494,7 +494,8 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
x264_sei_payload_t *sei_payload;
if (side_data->type != AV_FRAME_DATA_SEI_UNREGISTERED)
continue;
- tmp = av_fast_realloc(sei->payloads, &sei_data_size, (sei->num_payloads + 1) * sizeof(*sei_payload));
+ tmp = av_realloc_reuse(sei->payloads, &sei_data_size,
+ (sei->num_payloads + 1) * sizeof(*sei_payload));
if (!tmp) {
free_picture(ctx);
return AVERROR(ENOMEM);
@@ -54,7 +54,7 @@ typedef struct libx265Context {
AVDictionary *x265_opts;
void *sei_data;
- int sei_data_size;
+ size_t sei_data_size;
int udu_sei;
/**
@@ -555,9 +555,9 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if (side_data->type != AV_FRAME_DATA_SEI_UNREGISTERED)
continue;
- tmp = av_fast_realloc(ctx->sei_data,
- &ctx->sei_data_size,
- (sei->numPayloads + 1) * sizeof(*sei_payload));
+ tmp = av_realloc_reuse(ctx->sei_data,
+ &ctx->sei_data_size,
+ (sei->numPayloads + 1) * sizeof(*sei_payload));
if (!tmp) {
av_freep(&x265pic.userData);
av_freep(&x265pic.quantOffsets);
@@ -76,7 +76,7 @@ typedef struct {
ASSStyle *ass_dialog_style;
StyleBox *style_attributes;
unsigned count;
- unsigned style_attributes_bytes_allocated;
+ size_t style_attributes_bytes_allocated;
StyleBox style_attributes_temp;
AVBPrint buffer;
HighlightBox hlit;
@@ -354,9 +354,9 @@ static int mov_text_style_start(MovTextContext *s)
// last style != defaults, end the style entry and start a new one
if (s->count + 1 > FFMIN(SIZE_MAX / sizeof(*s->style_attributes), UINT16_MAX) ||
- !(tmp = av_fast_realloc(s->style_attributes,
- &s->style_attributes_bytes_allocated,
- (s->count + 1) * sizeof(*s->style_attributes)))) {
+ !(tmp = av_realloc_reuse(s->style_attributes,
+ &s->style_attributes_bytes_allocated,
+ (s->count + 1) * sizeof(*s->style_attributes)))) {
mov_text_cleanup(s);
av_bprint_clear(&s->buffer);
s->box_flags &= ~STYL_BOX;
@@ -677,8 +677,8 @@ int ff_nvdec_simple_decode_slice(AVCodecContext *avctx, const uint8_t *buffer,
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));
+ tmp = av_realloc_reuse(ctx->slice_offsets, &ctx->slice_offsets_allocated,
+ (ctx->nb_slices + 1) * sizeof(*ctx->slice_offsets));
if (!tmp)
return AVERROR(ENOMEM);
ctx->slice_offsets = tmp;
@@ -58,12 +58,12 @@ typedef struct NVDECContext {
uint8_t *bitstream;
int bitstream_len;
- unsigned int bitstream_allocated;
+ size_t bitstream_allocated;
uint8_t *bitstream_internal;
unsigned *slice_offsets;
int nb_slices;
- unsigned int slice_offsets_allocated;
+ size_t slice_offsets_allocated;
int supports_444;
} NVDECContext;
@@ -293,8 +293,8 @@ static int nvdec_av1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer,
ctx->nb_slices = frame_header->tile_cols * frame_header->tile_rows;
- tmp = av_fast_realloc(ctx->slice_offsets, &ctx->slice_offsets_allocated,
- ctx->nb_slices * 2 * sizeof(*ctx->slice_offsets));
+ tmp = av_realloc_reuse(ctx->slice_offsets, &ctx->slice_offsets_allocated,
+ ctx->nb_slices * 2 * sizeof(*ctx->slice_offsets));
if (!tmp) {
return AVERROR(ENOMEM);
}
@@ -313,8 +313,8 @@ static int nvdec_av1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer,
return 0;
}
- tmp = av_fast_realloc(ctx->bitstream_internal, &ctx->bitstream_allocated,
- ctx->bitstream_len + size);
+ tmp = av_realloc_reuse(ctx->bitstream_internal, &ctx->bitstream_allocated,
+ ctx->bitstream_len + size);
if (!tmp) {
return AVERROR(ENOMEM);
}
@@ -137,14 +137,14 @@ static int nvdec_h264_decode_slice(AVCodecContext *avctx, const uint8_t *buffer,
const H264SliceContext *sl = &h->slice_ctx[0];
void *tmp;
- tmp = av_fast_realloc(ctx->bitstream, &ctx->bitstream_allocated,
- ctx->bitstream_len + size + 3);
+ tmp = av_realloc_reuse(ctx->bitstream, &ctx->bitstream_allocated,
+ ctx->bitstream_len + size + 3);
if (!tmp)
return AVERROR(ENOMEM);
ctx->bitstream = tmp;
- tmp = av_fast_realloc(ctx->slice_offsets, &ctx->slice_offsets_allocated,
- (ctx->nb_slices + 1) * sizeof(*ctx->slice_offsets));
+ tmp = av_realloc_reuse(ctx->slice_offsets, &ctx->slice_offsets_allocated,
+ (ctx->nb_slices + 1) * sizeof(*ctx->slice_offsets));
if (!tmp)
return AVERROR(ENOMEM);
ctx->slice_offsets = tmp;
@@ -273,14 +273,14 @@ static int nvdec_hevc_decode_slice(AVCodecContext *avctx, const uint8_t *buffer,
NVDECContext *ctx = avctx->internal->hwaccel_priv_data;
void *tmp;
- tmp = av_fast_realloc(ctx->bitstream, &ctx->bitstream_allocated,
- ctx->bitstream_len + size + 3);
+ tmp = av_realloc_reuse(ctx->bitstream, &ctx->bitstream_allocated,
+ ctx->bitstream_len + size + 3);
if (!tmp)
return AVERROR(ENOMEM);
ctx->bitstream = tmp;
- tmp = av_fast_realloc(ctx->slice_offsets, &ctx->slice_offsets_allocated,
- (ctx->nb_slices + 1) * sizeof(*ctx->slice_offsets));
+ tmp = av_realloc_reuse(ctx->slice_offsets, &ctx->slice_offsets_allocated,
+ (ctx->nb_slices + 1) * sizeof(*ctx->slice_offsets));
if (!tmp)
return AVERROR(ENOMEM);
ctx->slice_offsets = tmp;
@@ -2202,9 +2202,9 @@ static int prepare_sei_data_array(AVCodecContext *avctx, const AVFrame *frame)
}
if (a53_data) {
- void *tmp = av_fast_realloc(ctx->sei_data,
- &ctx->sei_data_size,
- (sei_count + 1) * sizeof(*ctx->sei_data));
+ void *tmp = av_realloc_reuse(ctx->sei_data,
+ &ctx->sei_data_size,
+ (sei_count + 1) * sizeof(*ctx->sei_data));
if (!tmp) {
av_free(a53_data);
res = AVERROR(ENOMEM);
@@ -2228,9 +2228,9 @@ static int prepare_sei_data_array(AVCodecContext *avctx, const AVFrame *frame)
}
if (tc_data) {
- void *tmp = av_fast_realloc(ctx->sei_data,
- &ctx->sei_data_size,
- (sei_count + 1) * sizeof(*ctx->sei_data));
+ void *tmp = av_realloc_reuse(ctx->sei_data,
+ &ctx->sei_data_size,
+ (sei_count + 1) * sizeof(*ctx->sei_data));
if (!tmp) {
av_free(tc_data);
res = AVERROR(ENOMEM);
@@ -2255,9 +2255,9 @@ static int prepare_sei_data_array(AVCodecContext *avctx, const AVFrame *frame)
if (side_data->type != AV_FRAME_DATA_SEI_UNREGISTERED)
continue;
- tmp = av_fast_realloc(ctx->sei_data,
- &ctx->sei_data_size,
- (sei_count + 1) * sizeof(*ctx->sei_data));
+ tmp = av_realloc_reuse(ctx->sei_data,
+ &ctx->sei_data_size,
+ (sei_count + 1) * sizeof(*ctx->sei_data));
if (!tmp) {
res = AVERROR(ENOMEM);
goto error;
@@ -174,7 +174,7 @@ typedef struct NvencContext
AVFifo *timestamp_list;
NV_ENC_SEI_PAYLOAD *sei_data;
- int sei_data_size;
+ size_t sei_data_size;
struct {
void *ptr;
@@ -221,9 +221,9 @@ int ff_combine_frame(ParseContext *pc, int next,
/* copy into buffer end return */
if (next == END_NOT_FOUND) {
- void *new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size,
- *buf_size + pc->index +
- AV_INPUT_BUFFER_PADDING_SIZE);
+ void *new_buffer = av_realloc_reuse(pc->buffer, &pc->buffer_size,
+ *buf_size + pc->index +
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!new_buffer) {
av_log(NULL, AV_LOG_ERROR, "Failed to reallocate parser buffer to %d\n", *buf_size + pc->index + AV_INPUT_BUFFER_PADDING_SIZE);
@@ -243,9 +243,9 @@ int ff_combine_frame(ParseContext *pc, int next,
/* append to buffer */
if (pc->index) {
- void *new_buffer = av_fast_realloc(pc->buffer, &pc->buffer_size,
- next + pc->index +
- AV_INPUT_BUFFER_PADDING_SIZE);
+ void *new_buffer = av_realloc_reuse(pc->buffer, &pc->buffer_size,
+ next + pc->index +
+ AV_INPUT_BUFFER_PADDING_SIZE);
if (!new_buffer) {
av_log(NULL, AV_LOG_ERROR, "Failed to reallocate parser buffer to %d\n", next + pc->index + AV_INPUT_BUFFER_PADDING_SIZE);
pc->overread_index =
@@ -29,7 +29,7 @@ typedef struct ParseContext{
uint8_t *buffer;
int index;
int last_index;
- unsigned int buffer_size;
+ size_t buffer_size;
uint32_t state; ///< contains the last few bytes in MSB order
int frame_start_found;
int overread; ///< the number of bytes which where irreversibly read from the next frame
@@ -97,7 +97,7 @@ typedef struct ShortenContext {
uint8_t *bitstream;
int bitstream_size;
int bitstream_index;
- unsigned int allocated_bitstream_size;
+ size_t allocated_bitstream_size;
int header_size;
uint8_t header[OUT_BUFFER_SIZE];
int version;
@@ -535,8 +535,8 @@ static int shorten_decode_frame(AVCodecContext *avctx, AVFrame *frame,
if (s->max_framesize == 0) {
void *tmp_ptr;
s->max_framesize = 8192; // should hopefully be enough for the first header
- tmp_ptr = av_fast_realloc(s->bitstream, &s->allocated_bitstream_size,
- s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE);
+ tmp_ptr = av_realloc_reuse(s->bitstream, &s->allocated_bitstream_size,
+ s->max_framesize + AV_INPUT_BUFFER_PADDING_SIZE);
if (!tmp_ptr) {
s->max_framesize = 0;
av_log(avctx, AV_LOG_ERROR, "error allocating bitstream buffer\n");
@@ -585,8 +585,8 @@ static int shorten_decode_frame(AVCodecContext *avctx, AVFrame *frame,
void *tmp_ptr;
max_framesize = FFMAX(s->max_framesize, s->blocksize * s->channels * 8);
- tmp_ptr = av_fast_realloc(s->bitstream, &s->allocated_bitstream_size,
- max_framesize + AV_INPUT_BUFFER_PADDING_SIZE);
+ tmp_ptr = av_realloc_reuse(s->bitstream, &s->allocated_bitstream_size,
+ max_framesize + AV_INPUT_BUFFER_PADDING_SIZE);
if (!tmp_ptr) {
av_log(avctx, AV_LOG_ERROR, "error allocating bitstream buffer\n");
return AVERROR(ENOMEM);
@@ -388,8 +388,8 @@ int ff_vdpau_add_buffer(struct vdpau_picture_context *pic_ctx,
{
VdpBitstreamBuffer *buffers = pic_ctx->bitstream_buffers;
- buffers = av_fast_realloc(buffers, &pic_ctx->bitstream_buffers_allocated,
- (pic_ctx->bitstream_buffers_used + 1) * sizeof(*buffers));
+ buffers = av_realloc_reuse(buffers, &pic_ctx->bitstream_buffers_allocated,
+ (pic_ctx->bitstream_buffers_used + 1) * sizeof(*buffers));
if (!buffers)
return AVERROR(ENOMEM);
@@ -104,7 +104,7 @@ struct vdpau_picture_context {
/**
* Allocated size of the bitstream_buffers table.
*/
- int bitstream_buffers_allocated;
+ size_t bitstream_buffers_allocated;
/**
* Useful bitstream buffers in the bitstream buffers table.
@@ -76,9 +76,9 @@ int ff_videotoolbox_buffer_copy(VTContext *vtctx,
{
void *tmp;
- tmp = av_fast_realloc(vtctx->bitstream,
- &vtctx->allocated_size,
- size);
+ tmp = av_realloc_reuse(vtctx->bitstream,
+ &vtctx->allocated_size,
+ size);
if (!tmp)
return AVERROR(ENOMEM);
@@ -432,9 +432,9 @@ static int videotoolbox_common_decode_slice(AVCodecContext *avctx,
VTContext *vtctx = avctx->internal->hwaccel_priv_data;
void *tmp;
- tmp = av_fast_realloc(vtctx->bitstream,
- &vtctx->allocated_size,
- vtctx->bitstream_size+size+4);
+ tmp = av_realloc_reuse(vtctx->bitstream,
+ &vtctx->allocated_size,
+ vtctx->bitstream_size+size+4);
if (!tmp)
return AVERROR(ENOMEM);
@@ -30,7 +30,7 @@ typedef struct VTContext {
int bitstream_size;
// The reference size used for fast reallocation.
- int allocated_size;
+ size_t allocated_size;
// The core video buffer
CVImageBufferRef frame;