mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2025-02-21 04:33:24 +00:00
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>
This commit is contained in:
parent
f18a5efb52
commit
fdf46b4a6b
@ -451,7 +451,7 @@ static int amf_copy_buffer(AVCodecContext *avctx, AVPacket *pkt, AMFBuffer *buff
|
|||||||
int64_t timestamp = AV_NOPTS_VALUE;
|
int64_t timestamp = AV_NOPTS_VALUE;
|
||||||
int64_t size = buffer->pVtbl->GetSize(buffer);
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
memcpy(pkt->data, buffer->pVtbl->GetNative(buffer), size);
|
memcpy(pkt->data, buffer->pVtbl->GetNative(buffer), size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user