diff options
author | James Almer <jamrial@gmail.com> | 2019-11-19 19:42:48 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-11-19 19:48:33 -0300 |
commit | 57365f67a0701473bf012c24fb1a7d045471a682 (patch) | |
tree | 238d4264b5f3d6830c72e16a4cb7a95c01bc3342 /libavcodec/amfenc.c | |
parent | 44fe41a1cae9bd05bfc76b2ac1e6add14f1dbebc (diff) | |
download | ffmpeg-57365f67a0701473bf012c24fb1a7d045471a682.tar.gz |
avcodec/amfnec: allocate packets using av_new_packet()
This ensures they will be reference counted, as required by the AVCodec.receive_packet()
API.
Should fix ticket #8386.
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit fdf46b4a6b36dd8551adc29c455326b1a13b4acb)
Diffstat (limited to 'libavcodec/amfenc.c')
-rw-r--r-- | libavcodec/amfenc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/amfenc.c b/libavcodec/amfenc.c index 384d8efc92..5af1cd002f 100644 --- a/libavcodec/amfenc.c +++ b/libavcodec/amfenc.c @@ -438,7 +438,7 @@ static int amf_copy_buffer(AVCodecContext *avctx, AVPacket *pkt, AMFBuffer *buff int64_t timestamp = AV_NOPTS_VALUE; int64_t size = buffer->pVtbl->GetSize(buffer); - if ((ret = ff_alloc_packet2(avctx, pkt, size, 0)) < 0) { + if ((ret = av_new_packet(pkt, size)) < 0) { return ret; } memcpy(pkt->data, buffer->pVtbl->GetNative(buffer), size); |