mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
avdevice/decklink_dec: unref packets on avpacket_queue_put error
Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit 649087fa83
)
This commit is contained in:
parent
0a22e31fbb
commit
d89eea3455
@ -467,16 +467,19 @@ static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt)
|
|||||||
|
|
||||||
// Drop Packet if queue size is > maximum queue size
|
// Drop Packet if queue size is > maximum queue size
|
||||||
if (avpacket_queue_size(q) > (uint64_t)q->max_q_size) {
|
if (avpacket_queue_size(q) > (uint64_t)q->max_q_size) {
|
||||||
|
av_packet_unref(pkt);
|
||||||
av_log(q->avctx, AV_LOG_WARNING, "Decklink input buffer overrun!\n");
|
av_log(q->avctx, AV_LOG_WARNING, "Decklink input buffer overrun!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* ensure the packet is reference counted */
|
/* ensure the packet is reference counted */
|
||||||
if (av_packet_make_refcounted(pkt) < 0) {
|
if (av_packet_make_refcounted(pkt) < 0) {
|
||||||
|
av_packet_unref(pkt);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pkt1 = (AVPacketList *)av_malloc(sizeof(AVPacketList));
|
pkt1 = (AVPacketList *)av_malloc(sizeof(AVPacketList));
|
||||||
if (!pkt1) {
|
if (!pkt1) {
|
||||||
|
av_packet_unref(pkt);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
av_packet_move_ref(&pkt1->pkt, pkt);
|
av_packet_move_ref(&pkt1->pkt, pkt);
|
||||||
|
Loading…
Reference in New Issue
Block a user