diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c index 784b51c52d..4456e300f2 100644 --- a/libavcodec/libx265.c +++ b/libavcodec/libx265.c @@ -294,7 +294,7 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt, for (i = 0; i < nnal; i++) payload += nal[i].sizeBytes; - ret = ff_alloc_packet(pkt, payload); + ret = ff_alloc_packet2(avctx, pkt, payload, payload); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n"); return ret;