diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c index 69ea6dc6bb..8da8421e47 100644 --- a/libavcodec/cbs_h2645.c +++ b/libavcodec/cbs_h2645.c @@ -1457,7 +1457,7 @@ static int cbs_h2645_assemble_fragment(CodedBitstreamContext *ctx, max_size += 3 + frag->units[i].data_size * 3 / 2; } - data = av_malloc(max_size + AV_INPUT_BUFFER_PADDING_SIZE); + data = av_realloc(NULL, max_size + AV_INPUT_BUFFER_PADDING_SIZE); if (!data) return AVERROR(ENOMEM);