History

avdevice/decklink_dec: unref packets on avpacket_queue_put error

Marton Balint committed 8 years ago

Commit 649087f1 parent 75d15291 file · +3 −0Browse files

Showing the changes to libavdevice/decklink_dec.cpp (1 of 1 file). Show all

Unified · Split

libavdevice/decklink_dec.cpp+3−0
@@ -475,16 +475,19 @@ static int avpacket_queue_put(AVPacketQueue *q, AVPacket *pkt) · 474 unmodified lines
475475
476476 // Drop Packet if queue size is > maximum queue size
477477 if (avpacket_queue_size(q) > (uint64_t)q->max_q_size) {
478+ av_packet_unref(pkt);
478479 av_log(q->avctx, AV_LOG_WARNING, "Decklink input buffer overrun!\n");
479480 return -1;
480481 }
481482 /* ensure the packet is reference counted */
482483 if (av_packet_make_refcounted(pkt) < 0) {
484+ av_packet_unref(pkt);
483485 return -1;
484486 }
485487
486488 pkt1 = (AVPacketList *)av_malloc(sizeof(AVPacketList));
487489 if (!pkt1) {
490+ av_packet_unref(pkt);
488491 return -1;
489492 }
490493 av_packet_move_ref(&pkt1->pkt, pkt);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t